3v4l.org

run code in 500+ PHP versions simultaneously
<?php interface SplStackFacadeInterface { public static function fromArray(array $arr); } class SplStackFacade extends SplStack implements SplStackFacadeInterface { public static function fromArray(array $arr): SplStack { $splStack = new self(); array_map([$splStack, 'push'], $arr); return $splStack; } } var_dump(SplStackFacade::fromArray([1, 2, 3, 4]));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Epj6l
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   DECLARE_CLASS                                                'splstackfacade', 'splstack'
   18     1        INIT_FCALL                                                   'var_dump'
          2        INIT_STATIC_METHOD_CALL                                      'SplStackFacade', 'fromArray'
          3        SEND_VAL_EX                                                  <array>
          4        DO_FCALL                                          0  $0      
          5        SEND_VAR                                                     $0
          6        DO_ICALL                                                     
          7      > RETURN                                                       1

Class SplStackFacadeInterface:
Function fromarray:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Epj6l
function name:  fromArray
number of ops:  2
compiled vars:  !0 = $arr
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   RECV                                                 !0      
          1      > RETURN                                                       null

End of function fromarray

End of class SplStackFacadeInterface.

Class SplStackFacade:
Function fromarray:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Epj6l
function name:  fromArray
number of ops:  14
compiled vars:  !0 = $arr, !1 = $splStack
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   RECV                                                 !0      
   12     1        NEW                              self                $2      
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !1, $2
   13     4        INIT_FCALL                                                   'array_map'
          5        INIT_ARRAY                                           ~5      !1
          6        ADD_ARRAY_ELEMENT                                    ~5      'push'
          7        SEND_VAL                                                     ~5
          8        SEND_VAR                                                     !0
          9        DO_ICALL                                                     
   14    10        VERIFY_RETURN_TYPE                                           !1
         11      > RETURN                                                       !1
   15    12*       VERIFY_RETURN_TYPE                                           
         13*     > RETURN                                                       null

End of function fromarray

End of class SplStackFacade.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
157.41 ms | 1753 KiB | 15 Q