3v4l.org

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

Function id:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/S2YSZ
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/S2YSZ
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:
161.85 ms | 1398 KiB | 14 Q