3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { protected static function bar($arg) { return $arg * 1; } protected static $map = [ 'a' => 1, 'b' => 2, 'c' => 3, 'd' => 4, 'e' => 5 ]; public static function test() { $foo = 'e'; if (isset(self::$map[$foo])) { $b = self::bar(self::$map[$foo]); } var_dump($b); } } Foo::test();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dMeXu
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   INIT_STATIC_METHOD_CALL                                  'Foo', 'test'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   1

Class Foo:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dMeXu
function name:  bar
number of ops:  4
compiled vars:  !0 = $arg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        MUL                                              ~1      !0, 1
          2      > RETURN                                                   ~1
    8     3*     > RETURN                                                   null

End of function bar

Function test:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 10
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/dMeXu
function name:  test
number of ops:  14
compiled vars:  !0 = $foo, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   ASSIGN                                                   !0, 'e'
   22     1        FETCH_STATIC_PROP_IS                             ~3      'map'
          2        ISSET_ISEMPTY_DIM_OBJ                         0          ~3, !0
          3      > JMPZ                                                     ~4, ->10
   23     4    >   INIT_STATIC_METHOD_CALL                                  'bar'
          5        FETCH_STATIC_PROP_R          unknown             ~5      'map'
          6        FETCH_DIM_R                                      ~6      ~5, !0
          7        SEND_VAL                                                 ~6
          8        DO_FCALL                                      0  $7      
          9        ASSIGN                                                   !1, $7
   26    10    >   INIT_FCALL                                               'var_dump'
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                                 
   27    13      > RETURN                                                   null

End of function test

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.3 ms | 1395 KiB | 15 Q