3v4l.org

run code in 300+ PHP versions simultaneously
<?php $query = []; if (count($query) > 0 ) { //check array have any value or not? echo json_encode($query, JSON_PRETTY_PRINT); } else{ echo json_encode("No Matching Record Found", JSON_PRETTY_PRINT); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 10
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8rtb1
function name:  (null)
number of ops:  16
compiled vars:  !0 = $query
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        COUNT                                            ~2      !0
          2        IS_SMALLER                                               0, ~2
          3      > JMPZ                                                     ~3, ->10
    6     4    >   INIT_FCALL                                               'json_encode'
          5        SEND_VAR                                                 !0
          6        SEND_VAL                                                 128
          7        DO_ICALL                                         $4      
          8        ECHO                                                     $4
    5     9      > JMP                                                      ->15
    8    10    >   INIT_FCALL                                               'json_encode'
         11        SEND_VAL                                                 'No+Matching+Record+Found'
         12        SEND_VAL                                                 128
         13        DO_ICALL                                         $5      
         14        ECHO                                                     $5
    9    15    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.89 ms | 1009 KiB | 14 Q