3v4l.org

run code in 300+ PHP versions simultaneously
<?php $content = ["foo" => "bar", "hello" => ["world", "people of the world"], "a" => 1]; $size = mb_strlen(json_encode($content, JSON_NUMERIC_CHECK), '8bit'); $JSONDATA= array( 'response' => true, 'error' => null, 'payload' => array( 'content' => $content, 'size' => $size ) ); $joutput = json_encode($JSONDATA,JSON_NUMERIC_CHECK); echo $joutput;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/P1g9F
function name:  (null)
number of ops:  23
compiled vars:  !0 = $content, !1 = $size, !2 = $JSONDATA, !3 = $joutput
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    4     1        INIT_FCALL                                               'mb_strlen'
          2        INIT_FCALL                                               'json_encode'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 32
          5        DO_ICALL                                         $5      
          6        SEND_VAR                                                 $5
          7        SEND_VAL                                                 '8bit'
          8        DO_ICALL                                         $6      
          9        ASSIGN                                                   !1, $6
    8    10        INIT_ARRAY                                       ~8      <true>, 'response'
         11        ADD_ARRAY_ELEMENT                                ~8      null, 'error'
   12    12        INIT_ARRAY                                       ~9      !0, 'content'
   13    13        ADD_ARRAY_ELEMENT                                ~9      !1, 'size'
         14        ADD_ARRAY_ELEMENT                                ~8      ~9, 'payload'
    6    15        ASSIGN                                                   !2, ~8
   17    16        INIT_FCALL                                               'json_encode'
         17        SEND_VAR                                                 !2
         18        SEND_VAL                                                 32
         19        DO_ICALL                                         $11     
         20        ASSIGN                                                   !3, $11
   18    21        ECHO                                                     !3
   19    22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.9 ms | 1000 KiB | 15 Q