3v4l.org

run code in 500+ PHP versions simultaneously
<?php class A { protected static $aliases = []; public static function doSomething() { foreach (static::$aliases as $column => $alias) { // do something echo "$column: $alias" . PHP_EOL; } } } class B extends A { protected static $aliases = [ 'id' => 'real_id', 'name' => 'real_name', ]; } $obj = B::doSomething();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/h3dP4
function name:  (null)
number of ops:  4
compiled vars:  !0 = $obj
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   21     0  E >   INIT_STATIC_METHOD_CALL                                      'B', 'doSomething'
          1        DO_FCALL                                          0  $1      
          2        ASSIGN                                                       !0, $1
          3      > RETURN                                                       1

Class A:
Function dosomething:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 10
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 10
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/h3dP4
function name:  doSomething
number of ops:  12
compiled vars:  !0 = $alias, !1 = $column
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   FETCH_STATIC_PROP_R              unknown             ~2      'aliases'
          1      > FE_RESET_R                                           $3      ~2, ->10
          2    > > FE_FETCH_R                                           ~4      $3, !0, ->10
          3    >   ASSIGN                                                       !1, ~4
   10     4        ROPE_INIT                                         3  ~7      !1
          5        ROPE_ADD                                          1  ~7      ~7, '%3A+'
          6        ROPE_END                                          2  ~6      ~7, !0
          7        CONCAT                                               ~9      ~6, '%0A'
          8        ECHO                                                         ~9
    8     9      > JMP                                                          ->2
         10    >   FE_FREE                                                      $3
   12    11      > RETURN                                                       null

End of function dosomething

End of class A.

Class B:
Function dosomething:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 10
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 10
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/h3dP4
function name:  doSomething
number of ops:  12
compiled vars:  !0 = $alias, !1 = $column
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   FETCH_STATIC_PROP_R              unknown             ~2      'aliases'
          1      > FE_RESET_R                                           $3      ~2, ->10
          2    > > FE_FETCH_R                                           ~4      $3, !0, ->10
          3    >   ASSIGN                                                       !1, ~4
   10     4        ROPE_INIT                                         3  ~7      !1
          5        ROPE_ADD                                          1  ~7      ~7, '%3A+'
          6        ROPE_END                                          2  ~6      ~7, !0
          7        CONCAT                                               ~9      ~6, '%0A'
          8        ECHO                                                         ~9
    8     9      > JMP                                                          ->2
         10    >   FE_FREE                                                      $3
   12    11      > RETURN                                                       null

End of function dosomething

End of class B.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
156.62 ms | 2065 KiB | 13 Q