3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test($var){ echo "test $var\n"; } class bla { public $foo = "test"; public function bar($str) { echo $this->foo($str),"\n"; // php5 fails w/o method below specified } public function foo($val){ echo __FUNCTION__; test($val); } } $objBla = new bla(); $objBla->bar("someval"); if (phpversion() >= "7.0.0"){ $objBla->foo("nother val"); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 13
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/tn0ir
function name:  (null)
number of ops:  14
compiled vars:  !0 = $objBla
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   NEW                                              $1      'bla'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   22     3        INIT_METHOD_CALL                                         !0, 'bar'
          4        SEND_VAL_EX                                              'someval'
          5        DO_FCALL                                      0          
   23     6        INIT_FCALL                                               'phpversion'
          7        DO_ICALL                                         $5      
          8        IS_SMALLER_OR_EQUAL                                      '7.0.0', $5
          9      > JMPZ                                                     ~6, ->13
   24    10    >   INIT_METHOD_CALL                                         !0, 'foo'
         11        SEND_VAL_EX                                              'nother+val'
         12        DO_FCALL                                      0          
   25    13    > > RETURN                                                   1

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

End of function test

Class bla:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tn0ir
function name:  bar
number of ops:  7
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   12     1        INIT_METHOD_CALL                                         'foo'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0  $1      
          4        ECHO                                                     $1
          5        ECHO                                                     '%0A'
   13     6      > RETURN                                                   null

End of function bar

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tn0ir
function name:  foo
number of ops:  6
compiled vars:  !0 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   16     1        ECHO                                                     'foo'
   17     2        INIT_FCALL                                               'test'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0          
   18     5      > RETURN                                                   null

End of function foo

End of class bla.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.19 ms | 1402 KiB | 16 Q