3v4l.org

run code in 300+ PHP versions simultaneously
<?php function id($x) { return $x; } class A { function foo() { echo 'a'; } } var_dump(PHP_VERSION_ID); if (PHP_VERSION_ID < 50400) { return id(new A())->foo(); } return (new A())->foo();
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 12
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/P2RaB
function name:  (null)
number of ops:  18
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                               'var_dump'
          1        SEND_VAL                                                 80000
          2        DO_ICALL                                                 
   11     3      > JMPZ                                                     <false>, ->12
   12     4    >   INIT_FCALL                                               'id'
          5        NEW                                              $1      'A'
          6        DO_FCALL                                      0          
          7        SEND_VAR                                                 $1
          8        DO_FCALL                                      0  $3      
          9        INIT_METHOD_CALL                                         $3, 'foo'
         10        DO_FCALL                                      0  $4      
         11      > RETURN                                                   $4
   15    12    >   NEW                                              $5      'A'
         13        DO_FCALL                                      0          
         14        INIT_METHOD_CALL                                         $5, 'foo'
         15        DO_FCALL                                      0  $7      
         16      > RETURN                                                   $7
         17*     > RETURN                                                   1

Function id:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/P2RaB
function name:  id
number of ops:  3
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1      > RETURN                                                   !0
          2*     > RETURN                                                   null

End of function id

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

End of function foo

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.48 ms | 1398 KiB | 16 Q