3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { static $modeMapping = array( 'bar' => 'Exception' ); public static function testing() { if (isset( self::$modeMapping[$mode] ) ) { return new self::$modeMapping[$mode]( ); } } } var_dump( Foo::testing() );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eY00J
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_STATIC_METHOD_CALL                                  'Foo', 'testing'
          2        DO_FCALL                                      0  $0      
          3        SEND_VAR                                                 $0
          4        DO_ICALL                                                 
          5      > RETURN                                                   1

Class Foo:
Function testing:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 9
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eY00J
function name:  testing
number of ops:  10
compiled vars:  !0 = $mode
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   FETCH_STATIC_PROP_IS                             ~1      'modeMapping'
          1        ISSET_ISEMPTY_DIM_OBJ                         0          ~1, !0
          2      > JMPZ                                                     ~2, ->9
    7     3    >   FETCH_STATIC_PROP_R          unknown             ~3      'modeMapping'
          4        FETCH_DIM_R                                      ~4      ~3, !0
          5        FETCH_CLASS                                   0  $5      ~4
          6        NEW                                              $6      $5
          7        DO_FCALL                                      0          
          8      > RETURN                                                   $6
    9     9    > > RETURN                                                   null

End of function testing

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156 ms | 1395 KiB | 15 Q