3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { protected static $masks = array( 'default' => 'somemask\n', 'other' => 'different mask' ); public function method($maskName = 'default') { if (array_key_exists($maskName, self::$masks)) { print self::$masks[$maskName]; } else { print 'not found'; } } } $a = new A(); $a->method('other'); $a->method(); $a->method('undefined');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bYR2q
function name:  (null)
number of ops:  12
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   NEW                                              $1      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   19     3        INIT_METHOD_CALL                                         !0, 'method'
          4        SEND_VAL_EX                                              'other'
          5        DO_FCALL                                      0          
   21     6        INIT_METHOD_CALL                                         !0, 'method'
          7        DO_FCALL                                      0          
   23     8        INIT_METHOD_CALL                                         !0, 'method'
          9        SEND_VAL_EX                                              'undefined'
         10        DO_FCALL                                      0          
         11      > RETURN                                                   1

Class A:
Function method:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 8
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bYR2q
function name:  method
number of ops:  10
compiled vars:  !0 = $maskName
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV_INIT                                        !0      'default'
    9     1        FETCH_STATIC_PROP_R          unknown             ~1      'masks'
          2        ARRAY_KEY_EXISTS                                         !0, ~1
          3      > JMPZ                                                     ~2, ->8
   10     4    >   FETCH_STATIC_PROP_R          unknown             ~3      'masks'
          5        FETCH_DIM_R                                      ~4      ~3, !0
          6        ECHO                                                     ~4
          7      > JMP                                                      ->9
   12     8    >   ECHO                                                     'not+found'
   14     9    > > RETURN                                                   null

End of function method

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
185 ms | 1394 KiB | 13 Q