3v4l.org

run code in 500+ PHP versions simultaneously
<?php $games = [["First", 1.14], ["2nd", 1.18], ["3rd", 1.22]]; $rand1 = array_rand($games); $rand2 = array_rand($games); $val1 = $games[$rand1][1]; $val2 = $games[$rand2][1]; echo sprintf( "The product of '%s' (%f) and '%s' (%f) is %f", $games[$rand1][0], $val1, $games[$rand2][0], $val2, $val1 * $val2 );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rgOCK
function name:  (null)
number of ops:  30
compiled vars:  !0 = $games, !1 = $rand1, !2 = $rand2, !3 = $val1, !4 = $val2
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    4     1        INIT_FCALL                                                   'array_rand'
          2        SEND_VAR                                                     !0
          3        DO_ICALL                                             $6      
          4        ASSIGN                                                       !1, $6
    5     5        INIT_FCALL                                                   'array_rand'
          6        SEND_VAR                                                     !0
          7        DO_ICALL                                             $8      
          8        ASSIGN                                                       !2, $8
    6     9        FETCH_DIM_R                                          ~10     !0, !1
         10        FETCH_DIM_R                                          ~11     ~10, 1
         11        ASSIGN                                                       !3, ~11
    7    12        FETCH_DIM_R                                          ~13     !0, !2
         13        FETCH_DIM_R                                          ~14     ~13, 1
         14        ASSIGN                                                       !4, ~14
    9    15        INIT_FCALL                                                   'sprintf'
   10    16        SEND_VAL                                                     'The+product+of+%27%25s%27+%28%25f%29+and+%27%25s%27+%28%25f%29+is+%25f'
   11    17        FETCH_DIM_R                                          ~16     !0, !1
         18        FETCH_DIM_R                                          ~17     ~16, 0
         19        SEND_VAL                                                     ~17
         20        SEND_VAR                                                     !3
         21        FETCH_DIM_R                                          ~18     !0, !2
         22        FETCH_DIM_R                                          ~19     ~18, 0
         23        SEND_VAL                                                     ~19
         24        SEND_VAR                                                     !4
         25        MUL                                                  ~20     !3, !4
         26        SEND_VAL                                                     ~20
    9    27        DO_ICALL                                             $21     
   11    28        ECHO                                                         $21
   12    29      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
161.06 ms | 1282 KiB | 15 Q