3v4l.org

run code in 300+ PHP versions simultaneously
<?php $items=23; $shortP = $items %10; $numP = ($items - $shortP) / 10 + 1; $extraI = $items - $numP; echo "There are $items items\n"; echo "They fit in $numP packages\n"; echo "Shipping cost is:\n"; echo " $numP * each_first cost\n"; echo " $extraI * each_next cost\n"; $ei = $items; $np = ($items - $ei) / 10 + 1; echo "cost = base * $np + next * " . ($items - $np) . "\n"; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1Ti9X
function name:  (null)
number of ops:  39
compiled vars:  !0 = $items, !1 = $shortP, !2 = $numP, !3 = $extraI, !4 = $ei, !5 = $np
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 23
    3     1        MOD                                              ~7      !0, 10
          2        ASSIGN                                                   !1, ~7
    4     3        SUB                                              ~9      !0, !1
          4        DIV                                              ~10     ~9, 10
          5        ADD                                              ~11     ~10, 1
          6        ASSIGN                                                   !2, ~11
    5     7        SUB                                              ~13     !0, !2
          8        ASSIGN                                                   !3, ~13
    7     9        ROPE_INIT                                     3  ~16     'There+are+'
         10        ROPE_ADD                                      1  ~16     ~16, !0
         11        ROPE_END                                      2  ~15     ~16, '+items%0A'
         12        ECHO                                                     ~15
    8    13        ROPE_INIT                                     3  ~19     'They+fit+in+'
         14        ROPE_ADD                                      1  ~19     ~19, !2
         15        ROPE_END                                      2  ~18     ~19, '+packages%0A'
         16        ECHO                                                     ~18
    9    17        ECHO                                                     'Shipping+cost+is%3A%0A'
   10    18        ROPE_INIT                                     3  ~22     '++++++'
         19        ROPE_ADD                                      1  ~22     ~22, !2
         20        ROPE_END                                      2  ~21     ~22, '+%2A+each_first+cost%0A'
         21        ECHO                                                     ~21
   11    22        ROPE_INIT                                     3  ~25     '++++++'
         23        ROPE_ADD                                      1  ~25     ~25, !3
         24        ROPE_END                                      2  ~24     ~25, '+%2A+each_next+cost%0A'
         25        ECHO                                                     ~24
   13    26        ASSIGN                                                   !4, !0
   14    27        SUB                                              ~28     !0, !4
         28        DIV                                              ~29     ~28, 10
         29        ADD                                              ~30     ~29, 1
         30        ASSIGN                                                   !5, ~30
   15    31        ROPE_INIT                                     3  ~33     'cost+%3D+base+%2A+'
         32        ROPE_ADD                                      1  ~33     ~33, !5
         33        ROPE_END                                      2  ~32     ~33, '+%2B+next+%2A+'
         34        SUB                                              ~35     !0, !5
         35        CONCAT                                           ~36     ~32, ~35
         36        CONCAT                                           ~37     ~36, '%0A'
         37        ECHO                                                     ~37
   16    38      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.67 ms | 1399 KiB | 13 Q