3v4l.org

run code in 300+ PHP versions simultaneously
<?php $rules= array('trim', 'max_length[10]', 'callback__test'); $rules[] = 'required'; if($index = array_search('required', $rules)) { $moved_rule = $rules[$index]; unset($rules[$index]); array_unshift($rules, $moved_rule); } if($index = array_search('trim', $rules)) { $moved_rule = $rules[$index]; unset($rules[$index]); array_unshift($rules, $moved_rule); } print_r($rules);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 16
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 29
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
Branch analysis from position: 16
filename:       /in/aNo9g
function name:  (null)
number of ops:  33
compiled vars:  !0 = $rules, !1 = $index, !2 = $moved_rule
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN_DIM                                               !0
          2        OP_DATA                                                  'required'
    6     3        INIT_FCALL                                               'array_search'
          4        SEND_VAL                                                 'required'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $5      
          7        ASSIGN                                           ~6      !1, $5
          8      > JMPZ                                                     ~6, ->16
    8     9    >   FETCH_DIM_R                                      ~7      !0, !1
         10        ASSIGN                                                   !2, ~7
    9    11        UNSET_DIM                                                !0, !1
   10    12        INIT_FCALL                                               'array_unshift'
         13        SEND_REF                                                 !0
         14        SEND_VAR                                                 !2
         15        DO_ICALL                                                 
   13    16    >   INIT_FCALL                                               'array_search'
         17        SEND_VAL                                                 'trim'
         18        SEND_VAR                                                 !0
         19        DO_ICALL                                         $10     
         20        ASSIGN                                           ~11     !1, $10
         21      > JMPZ                                                     ~11, ->29
   15    22    >   FETCH_DIM_R                                      ~12     !0, !1
         23        ASSIGN                                                   !2, ~12
   16    24        UNSET_DIM                                                !0, !1
   17    25        INIT_FCALL                                               'array_unshift'
         26        SEND_REF                                                 !0
         27        SEND_VAR                                                 !2
         28        DO_ICALL                                                 
   20    29    >   INIT_FCALL                                               'print_r'
         30        SEND_VAR                                                 !0
         31        DO_ICALL                                                 
         32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
191.95 ms | 1396 KiB | 19 Q