3v4l.org

run code in 300+ PHP versions simultaneously
<?php $pricePerDay = 800; $days = range(1,20); $arr = array(); foreach ($days as $day) { $price = ($day * $pricePerDay); $arr[] = [$day => $price]; //echo sprintf('Dag: %s, Pris: %s ', $day, $price) . PHP_EOL; echo sprintf("[%s => %s],", $day, $price) . PHP_EOL; } //echo var_export($arr);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 22
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 22
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/8QA0D
function name:  (null)
number of ops:  24
compiled vars:  !0 = $pricePerDay, !1 = $days, !2 = $arr, !3 = $day, !4 = $price
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 800
    4     1        INIT_FCALL                                               'range'
          2        SEND_VAL                                                 1
          3        SEND_VAL                                                 20
          4        DO_ICALL                                         $6      
          5        ASSIGN                                                   !1, $6
    6     6        ASSIGN                                                   !2, <array>
    8     7      > FE_RESET_R                                       $9      !1, ->22
          8    > > FE_FETCH_R                                               $9, !3, ->22
    9     9    >   MUL                                              ~10     !3, !0
         10        ASSIGN                                                   !4, ~10
   10    11        INIT_ARRAY                                       ~13     !4, !3
         12        ASSIGN_DIM                                               !2
         13        OP_DATA                                                  ~13
   12    14        INIT_FCALL                                               'sprintf'
         15        SEND_VAL                                                 '%5B%25s+%3D%3E+%25s%5D%2C'
         16        SEND_VAR                                                 !3
         17        SEND_VAR                                                 !4
         18        DO_ICALL                                         $14     
         19        CONCAT                                           ~15     $14, '%0A'
         20        ECHO                                                     ~15
    8    21      > JMP                                                      ->8
         22    >   FE_FREE                                                  $9
   15    23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.25 ms | 1395 KiB | 17 Q