3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { public static $var_1 = 'foo_var'; public function printItem($string) { echo 'Foo: ' . $string . PHP_EOL; } public function printPHP() { echo 'PHP is great.' . PHP_EOL; } } class bar extends foo { public static $var_1 = 'bar_var'; public function printItem($string) { echo 'Bar: ' . $string . PHP_EOL; } } $foo = new foo(); $bar = new bar(); $bar->printItem('baz');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Kof0G
function name:  (null)
number of ops:  10
compiled vars:  !0 = $foo, !1 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   NEW                                              $2      'foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   26     3        NEW                                              $5      'bar'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $5
   28     6        INIT_METHOD_CALL                                         !1, 'printItem'
          7        SEND_VAL_EX                                              'baz'
          8        DO_FCALL                                      0          
          9      > RETURN                                                   1

Class foo:
Function printitem:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Kof0G
function name:  printItem
number of ops:  5
compiled vars:  !0 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        CONCAT                                           ~1      'Foo%3A+', !0
          2        CONCAT                                           ~2      ~1, '%0A'
          3        ECHO                                                     ~2
    9     4      > RETURN                                                   null

End of function printitem

Function printphp:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Kof0G
function name:  printPHP
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ECHO                                                     'PHP+is+great.%0A'
   13     1      > RETURN                                                   null

End of function printphp

End of class foo.

Class bar:
Function printitem:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Kof0G
function name:  printItem
number of ops:  5
compiled vars:  !0 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
   21     1        CONCAT                                           ~1      'Bar%3A+', !0
          2        CONCAT                                           ~2      ~1, '%0A'
          3        ECHO                                                     ~2
   22     4      > RETURN                                                   null

End of function printitem

Function printphp:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Kof0G
function name:  printPHP
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ECHO                                                     'PHP+is+great.%0A'
   13     1      > RETURN                                                   null

End of function printphp

End of class bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.22 ms | 1386 KiB | 13 Q