3v4l.org

run code in 500+ PHP versions simultaneously
<?php ini_set('error_reporting', E_ALL); ini_set('display_errors', 1); class Foo { /** * Values * @var array */ const VALUES = [ 'key1' => 'value1', 'key2' => 'value2', 'key3' => 'value3' ]; /** * Test function */ public function execute() { $key = 'key4'; if (!empty(self::VALUES[$key])) { self::VALUES[$key]; } else { echo 'The key doesn\'t found in this array.'; } } } $foo = new Foo(); $foo->execute();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7bfQS
function name:  (null)
number of ops:  14
compiled vars:  !0 = $foo
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                                   'ini_set'
          1        SEND_VAL                                                     'error_reporting'
          2        SEND_VAL                                                     30719
          3        DO_ICALL                                                     
    4     4        INIT_FCALL                                                   'ini_set'
          5        SEND_VAL                                                     'display_errors'
          6        SEND_VAL                                                     1
          7        DO_ICALL                                                     
   32     8        NEW                                                  $3      'Foo'
          9        DO_FCALL                                          0          
         10        ASSIGN                                                       !0, $3
   33    11        INIT_METHOD_CALL                                             !0, 'execute'
         12        DO_FCALL                                          0          
         13      > RETURN                                                       1

Class Foo:
Function execute:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7bfQS
function name:  execute
number of ops:  9
compiled vars:  !0 = $key
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   23     0  E >   ASSIGN                                                       !0, 'key4'
   24     1        ISSET_ISEMPTY_DIM_OBJ                             1  ~2      <array>, !0
          2        BOOL_NOT                                             ~3      ~2
          3      > JMPZ                                                         ~3, ->7
   25     4    >   FETCH_DIM_R                                          ~4      <array>, !0
          5        FREE                                                         ~4
   24     6      > JMP                                                          ->8
   27     7    >   ECHO                                                         'The+key+doesn%27t+found+in+this+array.'
   29     8    > > RETURN                                                       null

End of function execute

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
168.72 ms | 2065 KiB | 14 Q