3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class Foo { abstract protected static function things(); protected $t; protected function __construct($t) { $this->t = $t; } public function getT() { return $this->t; } public static function all() { return array_map(function($t) { return new static($t); }, static::things()); } } class Bar extends Foo { protected static function things() { return [10, 20, 30]; } } $bars = Bar::all(); foreach ($bars as $bar) { echo $bar->getT()."\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 10
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 10
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/LoBCV
function name:  (null)
number of ops:  12
compiled vars:  !0 = $bars, !1 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   INIT_STATIC_METHOD_CALL                                  'Bar', 'all'
          1        DO_FCALL                                      0  $2      
          2        ASSIGN                                                   !0, $2
   26     3      > FE_RESET_R                                       $4      !0, ->10
          4    > > FE_FETCH_R                                               $4, !1, ->10
   27     5    >   INIT_METHOD_CALL                                         !1, 'getT'
          6        DO_FCALL                                      0  $5      
          7        CONCAT                                           ~6      $5, '%0A'
          8        ECHO                                                     ~6
   26     9      > JMP                                                      ->4
         10    >   FE_FREE                                                  $4
   28    11      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FLoBCV%3A15%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LoBCV
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
          1        NEW                          static              $1      
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4      > RETURN                                                   $1
          5*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FLoBCV%3A15%240

Class Foo:
Function things:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LoBCV
function name:  things
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E > > RETURN                                                   null

End of function things

Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LoBCV
function name:  __construct
number of ops:  4
compiled vars:  !0 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        ASSIGN_OBJ                                               't'
          2        OP_DATA                                                  !0
    9     3      > RETURN                                                   null

End of function __construct

Function gett:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LoBCV
function name:  getT
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   FETCH_OBJ_R                                      ~0      't'
          1      > RETURN                                                   ~0
   12     2*     > RETURN                                                   null

End of function gett

Function all:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LoBCV
function name:  all
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'array_map'
          1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FLoBCV%3A15%240'
          2        SEND_VAL                                                 ~0
          3        INIT_STATIC_METHOD_CALL                                  'things'
          4        DO_FCALL                                      0  $1      
          5        SEND_VAR                                                 $1
          6        DO_ICALL                                         $2      
          7      > RETURN                                                   $2
   16     8*     > RETURN                                                   null

End of function all

End of class Foo.

Class Bar:
Function things:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LoBCV
function name:  things
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E > > RETURN                                                   <array>
   22     1*     > RETURN                                                   null

End of function things

Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LoBCV
function name:  __construct
number of ops:  4
compiled vars:  !0 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        ASSIGN_OBJ                                               't'
          2        OP_DATA                                                  !0
    9     3      > RETURN                                                   null

End of function __construct

Function gett:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LoBCV
function name:  getT
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   FETCH_OBJ_R                                      ~0      't'
          1      > RETURN                                                   ~0
   12     2*     > RETURN                                                   null

End of function gett

Function all:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LoBCV
function name:  all
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'array_map'
          1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FLoBCV%3A15%240'
          2        SEND_VAL                                                 ~0
          3        INIT_STATIC_METHOD_CALL                                  'things'
          4        DO_FCALL                                      0  $1      
          5        SEND_VAR                                                 $1
          6        DO_ICALL                                         $2      
          7      > RETURN                                                   $2
   16     8*     > RETURN                                                   null

End of function all

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.91 ms | 1409 KiB | 15 Q