3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function foo1() { echo 1; } $foo1 = 'foo1'; $foo1(); $foo2 = function () { echo 2; }; $foo2(); class Three { public function __invoke() { echo 3; } } $foo3 = new Three(); $foo3(); class Bar { static function foo4() { echo 4;} function foo5() { echo 5; } } $foo4 = array(new Bar, 'foo4'); $foo4(); // we should make this work $foo3 = 'Bar::foo3'; $foo3(); // we should make this work
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/88fF4
function name:  (null)
number of ops:  26
compiled vars:  !0 = $foo1, !1 = $foo2, !2 = $foo3, !3 = $foo4
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   NOP                                                      
   4     1        ASSIGN                                                   !0, 'foo1'
   5     2        INIT_DYNAMIC_CALL                                        !0
         3        DO_FCALL                                      0          
   8     4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F88fF40x7ffaf363405c'
         5        ASSIGN                                                   !1, ~6
   9     6        INIT_DYNAMIC_CALL                                        !1
         7        DO_FCALL                                      0          
  12     8        NOP                                                      
  15     9        NEW                                              $10     :-4
        10        DO_FCALL                                      0          
        11        ASSIGN                                                   !2, $10
  16    12        INIT_DYNAMIC_CALL                                        !2
        13        DO_FCALL                                      0          
  19    14        NOP                                                      
  25    15        NEW                                              $15     :-2
        16        DO_FCALL                                      0          
        17        INIT_ARRAY                                       ~17     $15
        18        ADD_ARRAY_ELEMENT                                ~17     'foo4'
        19        ASSIGN                                                   !3, ~17
  26    20        INIT_DYNAMIC_CALL                                        !3
        21        DO_FCALL                                      0          
  28    22        ASSIGN                                                   !2, 'Bar%3A%3Afoo3'
  29    23        INIT_DYNAMIC_CALL                                        !2
        24        DO_FCALL                                      0          
        25      > RETURN                                                   1

Function foo1:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/88fF4
function name:  foo1
number of ops:  2
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   ECHO                                                     1
         1      > RETURN                                                   null

End of function foo1

Function %00%7Bclosure%7D%2Fin%2F88fF40x7ffaf363405c:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/88fF4
function name:  {closure}
number of ops:  2
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   8     0  E >   ECHO                                                     2
         1      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F88fF40x7ffaf363405c

Class Three:
Function __invoke:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/88fF4
function name:  __invoke
number of ops:  2
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  13     0  E >   ECHO                                                     3
         1      > RETURN                                                   null

End of function __invoke

End of class Three.

Class Bar:
Function foo4:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/88fF4
function name:  foo4
number of ops:  2
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  20     0  E >   ECHO                                                     4
         1      > RETURN                                                   null

End of function foo4

Function foo5:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/88fF4
function name:  foo5
number of ops:  2
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  21     0  E >   ECHO                                                     5
         1      > RETURN                                                   null

End of function foo5

End of class Bar.

Generated using Vulcan Logic Dumper, using php 7.2.0