3v4l.org

run code in 300+ PHP versions simultaneously
<?php //create function to compare first letter of item to the aisle arrays function checkAisle($term) { $item= "banana"; $letters = array("A", "B", "C", "D", "E", "F", "G","H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T","U", "V", "W", "X", "Y", "Z"); $aisles = array("1", "1", "1", "1", "1", "1", "1","1", "1", "1", "1", "1", "1", "2", "2", "2", "2", "2", "2", "2","2", "2", "2", "2", "2", "2"); $guide = array_combine($letters, $aisles); $itemUC = ucfirst($item); $firstChar = $itemUC[0]; echo "$itemUC is located on Aisle $guide[$firstChar]."; } //run function checkAisle("banana");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SddjA
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'checkaisle'
          1        SEND_VAL                                                 'banana'
          2        DO_FCALL                                      0          
          3      > RETURN                                                   1

Function checkaisle:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SddjA
function name:  checkAisle
number of ops:  22
compiled vars:  !0 = $term, !1 = $item, !2 = $letters, !3 = $aisles, !4 = $guide, !5 = $itemUC, !6 = $firstChar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        ASSIGN                                                   !1, 'banana'
    5     2        ASSIGN                                                   !2, <array>
    6     3        ASSIGN                                                   !3, <array>
    7     4        INIT_FCALL                                               'array_combine'
          5        SEND_VAR                                                 !2
          6        SEND_VAR                                                 !3
          7        DO_ICALL                                         $10     
          8        ASSIGN                                                   !4, $10
    8     9        INIT_FCALL                                               'ucfirst'
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                         $12     
         12        ASSIGN                                                   !5, $12
    9    13        FETCH_DIM_R                                      ~14     !5, 0
         14        ASSIGN                                                   !6, ~14
   10    15        ROPE_INIT                                     4  ~18     !5
         16        ROPE_ADD                                      1  ~18     ~18, '+is+located+on+Aisle+'
         17        FETCH_DIM_R                                      ~16     !4, !6
         18        ROPE_ADD                                      2  ~18     ~18, ~16
         19        ROPE_END                                      3  ~17     ~18, '.'
         20        ECHO                                                     ~17
   11    21      > RETURN                                                   null

End of function checkaisle

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.06 ms | 1014 KiB | 16 Q