3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Faker { class Factory { public static function create(string $lang) { return new class() { public $name = 'someName'; }; } } } namespace { function index() { $faker = Faker\Factory::create('fr_FR'); $ideas = []; $ideas = []; for($i = rand(10, 50); $i > 0; $i--) { $ideas[] = new class($ideas, $faker) { private $id; private $author; function __construct($ideas, $faker) { $this->id = count($ideas) + 1; $this->author = $faker->name; } }; } var_dump($ideas); echo PHP_EOL; echo PHP_EOL; echo PHP_EOL; echo PHP_EOL; } index(); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sAguM
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   42     0  E >   INIT_FCALL                                               'index'
          1        DO_FCALL                                      0          
   43     2      > RETURN                                                   1

Function index:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 12
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 12
Branch analysis from position: 22
Branch analysis from position: 12
filename:       /in/sAguM
function name:  index
number of ops:  30
compiled vars:  !0 = $faker, !1 = $ideas, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_STATIC_METHOD_CALL                                  'Faker%5CFactory', 'create'
          1        SEND_VAL                                                 'fr_FR'
          2        DO_FCALL                                      0  $3      
          3        ASSIGN                                                   !0, $3
   19     4        ASSIGN                                                   !1, <array>
   21     5        ASSIGN                                                   !1, <array>
   22     6        INIT_FCALL                                               'rand'
          7        SEND_VAL                                                 10
          8        SEND_VAL                                                 50
          9        DO_ICALL                                         $7      
         10        ASSIGN                                                   !2, $7
         11      > JMP                                                      ->20
   23    12    >   DECLARE_ANON_CLASS                               <unknown> 
         13        NEW                                              $11     $10
         14        SEND_VAR_EX                                              !1
         15        SEND_VAR_EX                                              !0
         16        DO_FCALL                                      0          
         17        ASSIGN_DIM                                               !1
         18        OP_DATA                                                  $11
   22    19        PRE_DEC                                                  !2
         20    >   IS_SMALLER                                               0, !2
         21      > JMPNZ                                                    ~14, ->12
   34    22    >   INIT_FCALL                                               'var_dump'
         23        SEND_VAR                                                 !1
         24        DO_ICALL                                                 
   36    25        ECHO                                                     '%0A'
   37    26        ECHO                                                     '%0A'
   38    27        ECHO                                                     '%0A'
   39    28        ECHO                                                     '%0A'
   40    29      > RETURN                                                   null

End of function index

Class class@anonymous: [no user functions]
Class Faker\Factory:
Function create:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sAguM
function name:  create
number of ops:  6
compiled vars:  !0 = $lang
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        DECLARE_ANON_CLASS                               <unknown> 
          2        NEW                                              $2      $1
          3        DO_FCALL                                      0          
          4      > RETURN                                                   $2
   10     5*     > RETURN                                                   null

End of function create

End of class Faker\Factory.

Class class@anonymous:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sAguM
function name:  __construct
number of ops:  10
compiled vars:  !0 = $ideas, !1 = $faker
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   28     2        COUNT                                            ~3      !0
          3        ADD                                              ~4      ~3, 1
          4        ASSIGN_OBJ                                               'id'
          5        OP_DATA                                                  ~4
   29     6        FETCH_OBJ_R                                      ~6      !1, 'name'
          7        ASSIGN_OBJ                                               'author'
          8        OP_DATA                                                  ~6
   30     9      > RETURN                                                   null

End of function __construct

End of class class@anonymous.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.8 ms | 1018 KiB | 16 Q