{"id":15023079,"url":"https://github.com/codysnider/opcode-analysis","last_synced_at":"2025-04-09T19:51:15.502Z","repository":{"id":117242392,"uuid":"203941053","full_name":"codysnider/opcode-analysis","owner":"codysnider","description":"A set of Docker images to test out PHP code against the interpreter to see the resulting opcodes with multiple PHP versions.","archived":false,"fork":false,"pushed_at":"2019-12-26T19:55:22.000Z","size":23,"stargazers_count":15,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-23T21:45:55.806Z","etag":null,"topics":["docker","dockerfile","dockerfiles","dockerfiles-linux","dockerfiles-windows","php","php5","php7","php71","php72"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codysnider.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-08-23T06:50:12.000Z","updated_at":"2024-07-13T09:34:19.000Z","dependencies_parsed_at":"2023-04-12T07:33:16.311Z","dependency_job_id":null,"html_url":"https://github.com/codysnider/opcode-analysis","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codysnider%2Fopcode-analysis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codysnider%2Fopcode-analysis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codysnider%2Fopcode-analysis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codysnider%2Fopcode-analysis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codysnider","download_url":"https://codeload.github.com/codysnider/opcode-analysis/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248103907,"owners_count":21048244,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","dockerfile","dockerfiles","dockerfiles-linux","dockerfiles-windows","php","php5","php7","php71","php72"],"created_at":"2024-09-24T19:58:42.868Z","updated_at":"2025-04-09T19:51:15.495Z","avatar_url":"https://github.com/codysnider.png","language":"Shell","readme":"# PHP Opcode Analysis Kit\n\nA set of Docker images to test out PHP code against the interpreter to see the resulting opcodes with multiple PHP versions.\n\n## Usage\n\nEdit the `test.php` file with the code you would like to test. From there, run the bash/PowerShell script to build the containers and test the code. \n\n### Linux\n\n```bash\n./run.sh\n```\n\n### Windows\n\n```powershell\n.\\run.ps1\n```\n## Test File\n\n```php\n\u003c?php\n\n$x = 'a';\n$y = $x.' b';\necho $y;\n\n$x = 'a';\n$y = \"$x b\";\necho $y;\n\n$x = 'a';\n$y = \"{$x} b\";\necho $y;\n```\n\n## Example Output\n\n```bash\nbranch: #  0; line:     3-   14; sop:     0; eop:    14; out1:  -2\npath #1: 0,\nFinding entry points\nBranch analysis from position: 0\nJump found. (Code = 62) Position 1 = -2\nfilename:       /test.php\nfunction name:  (null)\nnumber of ops:  15\ncompiled vars:  !0 = $x, !1 = $y\nline     #* E I O op                           fetch          ext  return  operands\n-------------------------------------------------------------------------------------\n   3     0  E \u003e   ASSIGN                                                   !0, 'a'\n   4     1        CONCAT                                           ~1      !0, '+b'\n         2        ASSIGN                                                   !1, ~1\n   5     3        ECHO                                                     !1\n   7     4        ASSIGN                                                   !0, 'a'\n   8     5        ADD_VAR                                          ~4      !0\n         6        ADD_STRING                                       ~4      ~4, '+b'\n         7        ASSIGN                                                   !1, ~4\n   9     8        ECHO                                                     !1\n  11     9        ASSIGN                                                   !0, 'a'\n  12    10        ADD_VAR                                          ~7      !0\n        11        ADD_STRING                                       ~7      ~7, '+b'\n        12        ASSIGN                                                   !1, ~7\n  13    13        ECHO                                                     !1\n  14    14      \u003e RETURN                                                   1\n\nFinding entry points\nBranch analysis from position: 0\n1 jumps found. (Code = 62) Position 1 = -2\nfilename:       /test.php\nfunction name:  (null)\nnumber of ops:  15\ncompiled vars:  !0 = $x, !1 = $y\nline     #* E I O op                           fetch          ext  return  operands\n-------------------------------------------------------------------------------------\n   3     0  E \u003e   ASSIGN                                                   !0, 'a'\n   4     1        CONCAT                                           ~3      !0, '+b'\n         2        ASSIGN                                                   !1, ~3\n   5     3        ECHO                                                     !1\n   7     4        ASSIGN                                                   !0, 'a'\n   8     5        NOP\n         6        FAST_CONCAT                                      ~6      !0, '+b'\n         7        ASSIGN                                                   !1, ~6\n   9     8        ECHO                                                     !1\n  11     9        ASSIGN                                                   !0, 'a'\n  12    10        NOP\n        11        FAST_CONCAT                                      ~9      !0, '+b'\n        12        ASSIGN                                                   !1, ~9\n  13    13        ECHO                                                     !1\n  14    14      \u003e RETURN                                                   1\n\nbranch: #  0; line:     3-   14; sop:     0; eop:    14; out0:  -2\npath #1: 0,\nFinding entry points\nBranch analysis from position: 0\n1 jumps found. (Code = 62) Position 1 = -2\nfilename:       /test.php\nfunction name:  (null)\nnumber of ops:  15\ncompiled vars:  !0 = $x, !1 = $y\nline     #* E I O op                           fetch          ext  return  operands\n-------------------------------------------------------------------------------------\n   3     0  E \u003e   ASSIGN                                                   !0, 'a'\n   4     1        CONCAT                                           ~3      !0, '+b'\n         2        ASSIGN                                                   !1, ~3\n   5     3        ECHO                                                     !1\n   7     4        ASSIGN                                                   !0, 'a'\n   8     5        NOP\n         6        FAST_CONCAT                                      ~6      !0, '+b'\n         7        ASSIGN                                                   !1, ~6\n   9     8        ECHO                                                     !1\n  11     9        ASSIGN                                                   !0, 'a'\n  12    10        NOP\n        11        FAST_CONCAT                                      ~9      !0, '+b'\n        12        ASSIGN                                                   !1, ~9\n  13    13        ECHO                                                     !1\n  14    14      \u003e RETURN                                                   1\n\nbranch: #  0; line:     3-   14; sop:     0; eop:    14; out0:  -2\npath #1: 0,\nFinding entry points\nBranch analysis from position: 0\n1 jumps found. (Code = 62) Position 1 = -2\nfilename:       /test.php\nfunction name:  (null)\nnumber of ops:  15\ncompiled vars:  !0 = $x, !1 = $y\nline     #* E I O op                           fetch          ext  return  operands\n-------------------------------------------------------------------------------------\n   3     0  E \u003e   ASSIGN                                                   !0, 'a'\n   4     1        CONCAT                                           ~3      !0, '+b'\n         2        ASSIGN                                                   !1, ~3\n   5     3        ECHO                                                     !1\n   7     4        ASSIGN                                                   !0, 'a'\n   8     5        NOP\n         6        FAST_CONCAT                                      ~6      !0, '+b'\n         7        ASSIGN                                                   !1, ~6\n   9     8        ECHO                                                     !1\n  11     9        ASSIGN                                                   !0, 'a'\n  12    10        NOP\n        11        FAST_CONCAT                                      ~9      !0, '+b'\n        12        ASSIGN                                                   !1, ~9\n  13    13        ECHO                                                     !1\n  14    14      \u003e RETURN                                                   1\n\nbranch: #  0; line:     3-   14; sop:     0; eop:    14; out0:  -2\npath #1: 0,\n```\n\nContributions are always welcome and happy testing!\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodysnider%2Fopcode-analysis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodysnider%2Fopcode-analysis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodysnider%2Fopcode-analysis/lists"}