3v4l.org

run code in 300+ PHP versions simultaneously
<?php $creditScore = 'fair'; $ascending = true; $creditScores = array('excellent', 'good', 'fair', 'poor', 'no_credit'); if ($ascending) { $creditScores = array_flip($creditScores); } $position = array_search($creditScore, $creditScores); $acceptableCreditScores = array_slice($creditScores, $position); var_dump($acceptableCreditScores);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 8
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/1SWmm
function name:  (null)
number of ops:  22
compiled vars:  !0 = $creditScore, !1 = $ascending, !2 = $creditScores, !3 = $position, !4 = $acceptableCreditScores
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'fair'
    4     1        ASSIGN                                                   !1, <true>
    6     2        ASSIGN                                                   !2, <array>
    7     3      > JMPZ                                                     !1, ->8
    8     4    >   INIT_FCALL                                               'array_flip'
          5        SEND_VAR                                                 !2
          6        DO_ICALL                                         $8      
          7        ASSIGN                                                   !2, $8
   11     8    >   INIT_FCALL                                               'array_search'
          9        SEND_VAR                                                 !0
         10        SEND_VAR                                                 !2
         11        DO_ICALL                                         $10     
         12        ASSIGN                                                   !3, $10
   12    13        INIT_FCALL                                               'array_slice'
         14        SEND_VAR                                                 !2
         15        SEND_VAR                                                 !3
         16        DO_ICALL                                         $12     
         17        ASSIGN                                                   !4, $12
   14    18        INIT_FCALL                                               'var_dump'
         19        SEND_VAR                                                 !4
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.94 ms | 1399 KiB | 21 Q