3v4l.org

run code in 300+ PHP versions simultaneously
<?php $content = ["foo" => "bar", "hello" => ["world", "people of the world"], "a" => 1]; $size = strlen(json_encode($content, JSON_NUMERIC_CHECK)); $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/L5vFk
function name:  (null)
number of ops:  20
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                                               'json_encode'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 32
          4        DO_ICALL                                         $5      
          5        STRLEN                                           ~6      $5
          6        ASSIGN                                                   !1, ~6
    8     7        INIT_ARRAY                                       ~8      <true>, 'response'
          8        ADD_ARRAY_ELEMENT                                ~8      null, 'error'
   12     9        INIT_ARRAY                                       ~9      !0, 'content'
   13    10        ADD_ARRAY_ELEMENT                                ~9      !1, 'size'
         11        ADD_ARRAY_ELEMENT                                ~8      ~9, 'payload'
    6    12        ASSIGN                                                   !2, ~8
   17    13        INIT_FCALL                                               'json_encode'
         14        SEND_VAR                                                 !2
         15        SEND_VAL                                                 32
         16        DO_ICALL                                         $11     
         17        ASSIGN                                                   !3, $11
   18    18        ECHO                                                     !3
   19    19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.69 ms | 999 KiB | 14 Q