3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo {} function bar() { static $i = 0; return ++$i; } function baz() { static $i = 0; return ++$i; } new Foo(bar()); (new ReflectionClass('Foo'))->newInstanceArgs([baz()]); echo "Did call bar " . bar() . " times\n"; echo "Did call baz " . baz() . " times\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JCokh
function name:  (null)
number of ops:  26
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $0      'Foo'
          1        INIT_FCALL                                               'bar'
          2        DO_FCALL                                      0  $1      
          3        SEND_VAR_NO_REF_EX                                       $1
          4        DO_FCALL                                      0          
          5        FREE                                                     $0
   16     6        NEW                                              $3      'ReflectionClass'
          7        SEND_VAL_EX                                              'Foo'
          8        DO_FCALL                                      0          
          9        INIT_METHOD_CALL                                         $3, 'newInstanceArgs'
         10        INIT_FCALL                                               'baz'
         11        DO_FCALL                                      0  $5      
         12        INIT_ARRAY                                       ~6      $5
         13        SEND_VAL_EX                                              ~6
         14        DO_FCALL                                      0          
   20    15        INIT_FCALL                                               'bar'
         16        DO_FCALL                                      0  $8      
         17        CONCAT                                           ~9      'Did+call+bar+', $8
         18        CONCAT                                           ~10     ~9, '+times%0A'
         19        ECHO                                                     ~10
   21    20        INIT_FCALL                                               'baz'
         21        DO_FCALL                                      0  $11     
         22        CONCAT                                           ~12     'Did+call+baz+', $11
         23        CONCAT                                           ~13     ~12, '+times%0A'
         24        ECHO                                                     ~13
         25      > RETURN                                                   1

Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JCokh
function name:  bar
number of ops:  4
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   BIND_STATIC                                              !0
    7     1        PRE_INC                                          ~1      !0
          2      > RETURN                                                   ~1
    8     3*     > RETURN                                                   null

End of function bar

Function baz:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JCokh
function name:  baz
number of ops:  4
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   BIND_STATIC                                              !0
   12     1        PRE_INC                                          ~1      !0
          2      > RETURN                                                   ~1
   13     3*     > RETURN                                                   null

End of function baz

Class Foo: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.22 ms | 1399 KiB | 17 Q