3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getMeat($foods) { if (!isset($foods['meat'])) { throw new Exception('There is no meat in this pie'); } $meatCount = count($foods['meats']); if($meatCount < 1) { throw new Exception('Where did all the meat go!?'); } var_dump($foods); $i = 0; $j = 1; while($i < $meatCount) { if ($foods['meats'][$i] < $foods['meats'][$j]) { $tempMeat = $foods['meats'][$i]; $foods['meats'][$i] = $foods['meats'][$j]; $foods['meats'][$j] = $tempMeat; } $i++; $j++; } var_dump($foods); } $foods = array( 'meats' => array('burgers', 'steak', 'sausages', 'kebabs'), 'cake' => array('victorian', 'chocolate', 'fruit', 'fudge'), ); getMeat($foods);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HkRfN
function name:  (null)
number of ops:  5
compiled vars:  !0 = $foods
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   37     0  E >   ASSIGN                                                   !0, <array>
   42     1        INIT_FCALL                                               'getmeat'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0          
          4      > RETURN                                                   1

Function getmeat:
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 = 108) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 17
Branch analysis from position: 13
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 42
Branch analysis from position: 42
2 jumps found. (Code = 44) Position 1 = 44, Position 2 = 23
Branch analysis from position: 44
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 40
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 44, Position 2 = 23
Branch analysis from position: 44
Branch analysis from position: 23
Branch analysis from position: 40
filename:       /in/HkRfN
function name:  getMeat
number of ops:  48
compiled vars:  !0 = $foods, !1 = $meatCount, !2 = $i, !3 = $j, !4 = $tempMeat
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        ISSET_ISEMPTY_DIM_OBJ                         0  ~5      !0, 'meat'
          2        BOOL_NOT                                         ~6      ~5
          3      > JMPZ                                                     ~6, ->8
    7     4    >   NEW                                              $7      'Exception'
          5        SEND_VAL_EX                                              'There+is+no+meat+in+this+pie'
          6        DO_FCALL                                      0          
          7      > THROW                                         0          $7
   10     8    >   FETCH_DIM_R                                      ~9      !0, 'meats'
          9        COUNT                                            ~10     ~9
         10        ASSIGN                                                   !1, ~10
   12    11        IS_SMALLER                                               !1, 1
         12      > JMPZ                                                     ~12, ->17
   13    13    >   NEW                                              $13     'Exception'
         14        SEND_VAL_EX                                              'Where+did+all+the+meat+go%21%3F'
         15        DO_FCALL                                      0          
         16      > THROW                                         0          $13
   16    17    >   INIT_FCALL                                               'var_dump'
         18        SEND_VAR                                                 !0
         19        DO_ICALL                                                 
   18    20        ASSIGN                                                   !2, 0
   19    21        ASSIGN                                                   !3, 1
   21    22      > JMP                                                      ->42
   23    23    >   FETCH_DIM_R                                      ~18     !0, 'meats'
         24        FETCH_DIM_R                                      ~19     ~18, !2
         25        FETCH_DIM_R                                      ~20     !0, 'meats'
         26        FETCH_DIM_R                                      ~21     ~20, !3
         27        IS_SMALLER                                               ~19, ~21
         28      > JMPZ                                                     ~22, ->40
   24    29    >   FETCH_DIM_R                                      ~23     !0, 'meats'
         30        FETCH_DIM_R                                      ~24     ~23, !2
         31        ASSIGN                                                   !4, ~24
   25    32        FETCH_DIM_R                                      ~28     !0, 'meats'
         33        FETCH_DIM_R                                      ~29     ~28, !3
         34        FETCH_DIM_W                                      $26     !0, 'meats'
         35        ASSIGN_DIM                                               $26, !2
         36        OP_DATA                                                  ~29
   26    37        FETCH_DIM_W                                      $30     !0, 'meats'
         38        ASSIGN_DIM                                               $30, !3
         39        OP_DATA                                                  !4
   29    40    >   PRE_INC                                                  !2
   30    41        PRE_INC                                                  !3
   21    42    >   IS_SMALLER                                               !2, !1
         43      > JMPNZ                                                    ~34, ->23
   34    44    >   INIT_FCALL                                               'var_dump'
         45        SEND_VAR                                                 !0
         46        DO_ICALL                                                 
   35    47      > RETURN                                                   null

End of function getmeat

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.75 ms | 1403 KiB | 16 Q