3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types = 1); /** * @return list<string> */ function generateList(string $name): array { $a = ['a', 'b', 'c', $name]; $b = ['d', 'e']; array_splice($a, 2, 0, $b); return $a; } $l = generateList('John'); var_dump(array_is_list($l)); var_dump($l);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TdJpn
function name:  (null)
number of ops:  14
compiled vars:  !0 = $l
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_FCALL                                               'generatelist'
          1        SEND_VAL                                                 'John'
          2        DO_FCALL                                      0  $1      
          3        ASSIGN                                                   !0, $1
   17     4        INIT_FCALL                                               'var_dump'
          5        INIT_FCALL                                               'array_is_list'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $3      
          8        SEND_VAR                                                 $3
          9        DO_ICALL                                                 
   18    10        INIT_FCALL                                               'var_dump'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                                 
         13      > RETURN                                                   1

Function generatelist:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TdJpn
function name:  generateList
number of ops:  17
compiled vars:  !0 = $name, !1 = $a, !2 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    8     1        INIT_ARRAY                                       ~3      'a'
          2        ADD_ARRAY_ELEMENT                                ~3      'b'
          3        ADD_ARRAY_ELEMENT                                ~3      'c'
          4        ADD_ARRAY_ELEMENT                                ~3      !0
          5        ASSIGN                                                   !1, ~3
    9     6        ASSIGN                                                   !2, <array>
   11     7        INIT_FCALL                                               'array_splice'
          8        SEND_REF                                                 !1
          9        SEND_VAL                                                 2
         10        SEND_VAL                                                 0
         11        SEND_VAR                                                 !2
         12        DO_ICALL                                                 
   13    13        VERIFY_RETURN_TYPE                                       !1
         14      > RETURN                                                   !1
   14    15*       VERIFY_RETURN_TYPE                                       
         16*     > RETURN                                                   null

End of function generatelist

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.36 ms | 1016 KiB | 17 Q