3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test($var) { echo "in function ",__FUNCTION__,"\n"; echo "Test: \$var == $var\n"; } class foo { static function hello(){ echo "hi\n"; } function bar() { $this->test('something'); } } $a = new foo(); $a->bar(); foo::hello(); var_dump(method_exists($a,'test')); var_dump(method_exists('foo','hello'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qMFtF
function name:  (null)
number of ops:  22
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   NEW                                              $1      'foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   21     3        INIT_METHOD_CALL                                         !0, 'bar'
          4        DO_FCALL                                      0          
   22     5        INIT_STATIC_METHOD_CALL                                  'foo', 'hello'
          6        DO_FCALL                                      0          
   23     7        INIT_FCALL                                               'var_dump'
          8        INIT_FCALL                                               'method_exists'
          9        SEND_VAR                                                 !0
         10        SEND_VAL                                                 'test'
         11        DO_ICALL                                         $6      
         12        SEND_VAR                                                 $6
         13        DO_ICALL                                                 
   24    14        INIT_FCALL                                               'var_dump'
         15        INIT_FCALL                                               'method_exists'
         16        SEND_VAL                                                 'foo'
         17        SEND_VAL                                                 'hello'
         18        DO_ICALL                                         $8      
         19        SEND_VAR                                                 $8
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qMFtF
function name:  test
number of ops:  9
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        ECHO                                                     'in+function+'
          2        ECHO                                                     'test'
          3        ECHO                                                     '%0A'
    5     4        ROPE_INIT                                     3  ~2      'Test%3A+%24var+%3D%3D+'
          5        ROPE_ADD                                      1  ~2      ~2, !0
          6        ROPE_END                                      2  ~1      ~2, '%0A'
          7        ECHO                                                     ~1
    6     8      > RETURN                                                   null

End of function test

Class foo:
Function hello:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qMFtF
function name:  hello
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   ECHO                                                     'hi%0A'
   12     1      > RETURN                                                   null

End of function hello

Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qMFtF
function name:  bar
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_METHOD_CALL                                         'test'
          1        SEND_VAL_EX                                              'something'
          2        DO_FCALL                                      0          
   17     3      > RETURN                                                   null

End of function bar

End of class foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
184.43 ms | 1400 KiB | 17 Q