3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Set { public function __construct(array $spec, $arg1 = null, $arg2 = null) { if (isset($spec[0]) && is_array($spec[0])) { // was called like Set::createFromArray([['foo'=>'bar'], false, 64]); } else { // was called like new Set(['foo'=>'bar'], false, 64) } } } class SetFactory { public function create(array $map, $arg1, $arg2) { return new Set($map, $arg1, $arg2); } public function createFromArray(array $spec) { return new Set($spec); } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M7HYX
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E > > RETURN                                                   1

Class Set:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 5, Position 2 = 8
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 10
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
Branch analysis from position: 8
filename:       /in/M7HYX
function name:  __construct
number of ops:  11
compiled vars:  !0 = $spec, !1 = $arg1, !2 = $arg2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      null
          2        RECV_INIT                                        !2      null
    7     3        ISSET_ISEMPTY_DIM_OBJ                         0  ~3      !0, 0
          4      > JMPZ_EX                                          ~3      ~3, ->8
          5    >   FETCH_DIM_R                                      ~4      !0, 0
          6        TYPE_CHECK                                  128  ~5      ~4
          7        BOOL                                             ~3      ~5
          8    > > JMPZ                                                     ~3, ->10
          9    > > JMP                                                      ->10
   12    10    > > RETURN                                                   null

End of function __construct

End of class Set.

Class SetFactory:
Function create:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M7HYX
function name:  create
number of ops:  10
compiled vars:  !0 = $map, !1 = $arg1, !2 = $arg2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
   19     3        NEW                                              $3      'Set'
          4        SEND_VAR_EX                                              !0
          5        SEND_VAR_EX                                              !1
          6        SEND_VAR_EX                                              !2
          7        DO_FCALL                                      0          
          8      > RETURN                                                   $3
   20     9*     > RETURN                                                   null

End of function create

Function createfromarray:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M7HYX
function name:  createFromArray
number of ops:  6
compiled vars:  !0 = $spec
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   RECV                                             !0      
   24     1        NEW                                              $1      'Set'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4      > RETURN                                                   $1
   25     5*     > RETURN                                                   null

End of function createfromarray

End of class SetFactory.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
200.73 ms | 1390 KiB | 13 Q