3v4l.org

run code in 300+ PHP versions simultaneously
<?php const FILE_NAME = "/tmp/hphp-test-include-twice.inc"; file_put_contents(FILE_NAME, '<?php function foo() { print("foo()\n"); }'); include FILE_NAME; foo(); file_put_contents(FILE_NAME, '<?php function bar() { print("bar()\n"); }'); include FILE_NAME; bar(); file_put_contents(FILE_NAME, '<?php function baz() { print("baz()\n"); }'); include FILE_NAME; baz();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KsWoF
function name:  (null)
number of ops:  29
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CONST                                            'FILE_NAME', '%2Ftmp%2Fhphp-test-include-twice.inc'
    5     1        INIT_FCALL                                               'file_put_contents'
          2        FETCH_CONSTANT                                   ~0      'FILE_NAME'
          3        SEND_VAL                                                 ~0
          4        SEND_VAL                                                 '%3C%3Fphp+function+foo%28%29+%7B+print%28%22foo%28%29%5Cn%22%29%3B+%7D'
          5        DO_ICALL                                                 
    6     6        FETCH_CONSTANT                                   ~2      'FILE_NAME'
          7        INCLUDE_OR_EVAL                                          ~2, INCLUDE
    7     8        INIT_FCALL_BY_NAME                                       'foo'
          9        DO_FCALL                                      0          
    8    10        INIT_FCALL                                               'file_put_contents'
         11        FETCH_CONSTANT                                   ~5      'FILE_NAME'
         12        SEND_VAL                                                 ~5
         13        SEND_VAL                                                 '%3C%3Fphp+function+bar%28%29+%7B+print%28%22bar%28%29%5Cn%22%29%3B+%7D'
         14        DO_ICALL                                                 
    9    15        FETCH_CONSTANT                                   ~7      'FILE_NAME'
         16        INCLUDE_OR_EVAL                                          ~7, INCLUDE
   10    17        INIT_FCALL_BY_NAME                                       'bar'
         18        DO_FCALL                                      0          
   11    19        INIT_FCALL                                               'file_put_contents'
         20        FETCH_CONSTANT                                   ~10     'FILE_NAME'
         21        SEND_VAL                                                 ~10
         22        SEND_VAL                                                 '%3C%3Fphp+function+baz%28%29+%7B+print%28%22baz%28%29%5Cn%22%29%3B+%7D'
         23        DO_ICALL                                                 
   12    24        FETCH_CONSTANT                                   ~12     'FILE_NAME'
         25        INCLUDE_OR_EVAL                                          ~12, INCLUDE
   13    26        INIT_FCALL_BY_NAME                                       'baz'
         27        DO_FCALL                                      0          
         28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.13 ms | 1387 KiB | 15 Q