3v4l.org

run code in 300+ PHP versions simultaneously
(<?php //Source: https://bugs.php.net/bug.php?id=63898 $key = "Foo " . chr(163); $array = array($key => ""); var_dump($array); $json = json_encode($array); var_dump($json); $array2 = array($key); var_dump($array2, json_encode($array2)); var_dump(json_encode(utf8_encode('hey now ' . chr(180) . ' you’re dumb'))); var_dump(json_encode('hey now ' . chr(180) . ' you’re dumb')); /* $x = 'Audio Pass: Get live NFL game audio while you’re on the road with Audio Pass.'; var_dump(htmlentities($x)); var_dump(htmlentities($x, ENT_COMPAT | ENT_SUBSTITUTE, 'ISO-8859-1')); var_dump(htmlentities($x, ENT_COMPAT | ENT_SUBSTITUTE, 'UTF-8')); */
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/X7kUZ
function name:  (null)
number of ops:  39
compiled vars:  !0 = $key, !1 = $array, !2 = $json, !3 = $array2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    1     0  E >   ECHO                                                     '%28'
    4     1        ASSIGN                                                   !0, 'Foo+%A3'
    5     2        INIT_ARRAY                                       ~5      '', !0
          3        ASSIGN                                                   !1, ~5
    7     4        INIT_FCALL                                               'var_dump'
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                                 
    8     7        INIT_FCALL                                               'json_encode'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                         $8      
         10        ASSIGN                                                   !2, $8
    9    11        INIT_FCALL                                               'var_dump'
         12        SEND_VAR                                                 !2
         13        DO_ICALL                                                 
   12    14        INIT_ARRAY                                       ~11     !0
         15        ASSIGN                                                   !3, ~11
   13    16        INIT_FCALL                                               'var_dump'
         17        SEND_VAR                                                 !3
         18        INIT_FCALL                                               'json_encode'
         19        SEND_VAR                                                 !3
         20        DO_ICALL                                         $13     
         21        SEND_VAR                                                 $13
         22        DO_ICALL                                                 
   19    23        INIT_FCALL                                               'var_dump'
         24        INIT_FCALL                                               'json_encode'
         25        INIT_FCALL                                               'utf8_encode'
         26        SEND_VAL                                                 'hey+now+%B4+you%E2%80%99re+dumb'
         27        DO_ICALL                                         $15     
         28        SEND_VAR                                                 $15
         29        DO_ICALL                                         $16     
         30        SEND_VAR                                                 $16
         31        DO_ICALL                                                 
   20    32        INIT_FCALL                                               'var_dump'
         33        INIT_FCALL                                               'json_encode'
         34        SEND_VAL                                                 'hey+now+%B4+you%E2%80%99re+dumb'
         35        DO_ICALL                                         $18     
         36        SEND_VAR                                                 $18
         37        DO_ICALL                                                 
   32    38      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.04 ms | 1396 KiB | 19 Q