3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a=array(); if(empty($a)) echo 'empty'; // 一个有效的 json 字符串 $json [] = '{"Organization": "PHP Documentation Team"}' ; // 一个无效的 json 字符串会导致一个语法错误,在这个例子里我们使用 ' 代替了 " 作为引号 $json [] = "{'Organization': 'PHP Documentation Team'}" ; // 无效的 UTF8 序列 $text = "\xB1\x31" ; $json = json_encode ( $text ); $error = json_last_error (); var_dump ( $json , $error === JSON_ERROR_UTF8 );
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 4
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
filename:       /in/L8ri1
function name:  (null)
number of ops:  22
compiled vars:  !0 = $a, !1 = $json, !2 = $text, !3 = $error
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ISSET_ISEMPTY_CV                                         !0
          2      > JMPZ                                                     ~5, ->4
          3    >   ECHO                                                     'empty'
    5     4    >   ASSIGN_DIM                                               !1
          5        OP_DATA                                                  '%7B%22Organization%22%3A+%22PHP+Documentation+Team%22%7D'
    8     6        ASSIGN_DIM                                               !1
          7        OP_DATA                                                  '%7B%27Organization%27%3A+%27PHP+Documentation+Team%27%7D'
   11     8        ASSIGN                                                   !2, '%B11'
   13     9        INIT_FCALL                                               'json_encode'
         10        SEND_VAR                                                 !2
         11        DO_ICALL                                         $9      
         12        ASSIGN                                                   !1, $9
   14    13        INIT_FCALL                                               'json_last_error'
         14        DO_ICALL                                         $11     
         15        ASSIGN                                                   !3, $11
   16    16        INIT_FCALL                                               'var_dump'
         17        SEND_VAR                                                 !1
         18        IS_IDENTICAL                                     ~13     !3, 5
         19        SEND_VAL                                                 ~13
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.47 ms | 940 KiB | 20 Q