3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = '{"products":[{"product_id":"057-10-1351","desired_quantity":1}],"nearby":"32765","radius":100,"multichannel_options":[{"multichannel_option":"none"}]}'; $id = 1; $zip = 2; $prox = 3; $x = (object)array( "products" => array( "product_id" => $id , "desired_quantity" => 1 ) , "nearby" => $zip , "radius" => $prox ); var_dump($x); print json_encode($x);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZeonG
function name:  (null)
number of ops:  19
compiled vars:  !0 = $str, !1 = $id, !2 = $zip, !3 = $prox, !4 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%7B%22products%22%3A%5B%7B%22product_id%22%3A%22057-10-1351%22%2C%22desired_quantity%22%3A1%7D%5D%2C%22nearby%22%3A%2232765%22%2C%22radius%22%3A100%2C%22multichannel_options%22%3A%5B%7B%22multichannel_option%22%3A%22none%22%7D%5D%7D'
    4     1        ASSIGN                                                   !1, 1
    5     2        ASSIGN                                                   !2, 2
    6     3        ASSIGN                                                   !3, 3
   10     4        INIT_ARRAY                                       ~9      !1, 'product_id'
   11     5        ADD_ARRAY_ELEMENT                                ~9      1, 'desired_quantity'
          6        INIT_ARRAY                                       ~10     ~9, 'products'
   13     7        ADD_ARRAY_ELEMENT                                ~10     !2, 'nearby'
   14     8        ADD_ARRAY_ELEMENT                                ~10     !3, 'radius'
          9        CAST                                          8  ~11     ~10
    8    10        ASSIGN                                                   !4, ~11
   16    11        INIT_FCALL                                               'var_dump'
         12        SEND_VAR                                                 !4
         13        DO_ICALL                                                 
   17    14        INIT_FCALL                                               'json_encode'
         15        SEND_VAR                                                 !4
         16        DO_ICALL                                         $14     
         17        ECHO                                                     $14
         18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.19 ms | 1386 KiB | 17 Q