3v4l.org

run code in 300+ PHP versions simultaneously
<?php //Source: https://bugs.php.net/bug.php?id=63898 $key = utf8_encode("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/qfZd1
function name:  (null)
number of ops:  41
compiled vars:  !0 = $key, !1 = $array, !2 = $json, !3 = $array2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'utf8_encode'
          1        SEND_VAL                                                 'Foo+%A3'
          2        DO_ICALL                                         $4      
          3        ASSIGN                                                   !0, $4
    5     4        INIT_ARRAY                                       ~6      '', !0
          5        ASSIGN                                                   !1, ~6
    7     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                                 
    8     9        INIT_FCALL                                               'json_encode'
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                         $9      
         12        ASSIGN                                                   !2, $9
    9    13        INIT_FCALL                                               'var_dump'
         14        SEND_VAR                                                 !2
         15        DO_ICALL                                                 
   12    16        INIT_ARRAY                                       ~12     !0
         17        ASSIGN                                                   !3, ~12
   13    18        INIT_FCALL                                               'var_dump'
         19        SEND_VAR                                                 !3
         20        INIT_FCALL                                               'json_encode'
         21        SEND_VAR                                                 !3
         22        DO_ICALL                                         $14     
         23        SEND_VAR                                                 $14
         24        DO_ICALL                                                 
   19    25        INIT_FCALL                                               'var_dump'
         26        INIT_FCALL                                               'json_encode'
         27        INIT_FCALL                                               'utf8_encode'
         28        SEND_VAL                                                 'hey+now+%B4+you%E2%80%99re+dumb'
         29        DO_ICALL                                         $16     
         30        SEND_VAR                                                 $16
         31        DO_ICALL                                         $17     
         32        SEND_VAR                                                 $17
         33        DO_ICALL                                                 
   20    34        INIT_FCALL                                               'var_dump'
         35        INIT_FCALL                                               'json_encode'
         36        SEND_VAL                                                 'hey+now+%B4+you%E2%80%99re+dumb'
         37        DO_ICALL                                         $19     
         38        SEND_VAR                                                 $19
         39        DO_ICALL                                                 
   32    40      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.14 ms | 1401 KiB | 19 Q