3v4l.org

run code in 300+ PHP versions simultaneously
<?php function rules() { $rules = []; $count=0; foreach ([1] as $item) { array_push($rules, array( $count=>[ 'name'=>'required|max:255', 'description'=>'required|max:9000' ] )); } return $rules; } var_dump($rules());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IMlNr
function name:  (null)
number of ops:  6
compiled vars:  !0 = $rules
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_DYNAMIC_CALL                                        !0
          2        DO_FCALL                                      0  $1      
          3        SEND_VAR                                                 $1
          4        DO_ICALL                                                 
          5      > RETURN                                                   1

Function rules:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 10
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 10
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/IMlNr
function name:  rules
number of ops:  13
compiled vars:  !0 = $rules, !1 = $count, !2 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, <array>
    6     1        ASSIGN                                                   !1, 0
    7     2      > FE_RESET_R                                       $5      <array>, ->10
          3    > > FE_FETCH_R                                               $5, !2, ->10
    8     4    >   INIT_FCALL                                               'array_push'
          5        SEND_REF                                                 !0
   10     6        INIT_ARRAY                                       ~6      <array>, !1
          7        SEND_VAL                                                 ~6
          8        DO_ICALL                                                 
    7     9      > JMP                                                      ->3
         10    >   FE_FREE                                                  $5
   15    11      > RETURN                                                   !0
   16    12*     > RETURN                                                   null

End of function rules

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.68 ms | 1395 KiB | 17 Q