<?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'));
*/
$text = 'hey ' . chr(160);
$arr = array('damnit' => $text);
$utf = utf8_encode($text);
$utfarr = array('damnit' => $utf);
$json = json_encode($arr,JSON_UNESCAPED_UNICODE);
$utfjson = json_encode($utfarr,JSON_UNESCAPED_UNICODE);
var_dump($json, $utfjson);
var_dump(json_decode($json), json_decode($utfjson));
/*
$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/4fGpv
function name: (null)
number of ops: 34
compiled vars: !0 = $text, !1 = $arr, !2 = $utf, !3 = $utfarr, !4 = $json, !5 = $utfjson
line #* E I O op fetch ext return operands
-------------------------------------------------------------------------------------
20 0 E > ASSIGN !0, 'hey+%A0'
21 1 INIT_ARRAY ~7 !0, 'damnit'
2 ASSIGN !1, ~7
22 3 INIT_FCALL 'utf8_encode'
4 SEND_VAR !0
5 DO_ICALL $9
6 ASSIGN !2, $9
23 7 INIT_ARRAY ~11 !2, 'damnit'
8 ASSIGN !3, ~11
24 9 INIT_FCALL 'json_encode'
10 SEND_VAR !1
11 SEND_VAL 256
12 DO_ICALL $13
13 ASSIGN !4, $13
25 14 INIT_FCALL 'json_encode'
15 SEND_VAR !3
16 SEND_VAL 256
17 DO_ICALL $15
18 ASSIGN !5, $15
26 19 INIT_FCALL 'var_dump'
20 SEND_VAR !4
21 SEND_VAR !5
22 DO_ICALL
27 23 INIT_FCALL 'var_dump'
24 INIT_FCALL 'json_decode'
25 SEND_VAR !4
26 DO_ICALL $18
27 SEND_VAR $18
28 INIT_FCALL 'json_decode'
29 SEND_VAR !5
30 DO_ICALL $19
31 SEND_VAR $19
32 DO_ICALL
38 33 > RETURN 1
Generated using Vulcan Logic Dumper, using php 8.0.0
preferences:
156.85 ms | 1396 KiB | 21 Q