3v4l.org

run code in 300+ PHP versions simultaneously
<?php $var = "lol"; if(isSerialized($var) === true){ unserialize($var); } else { echo "KO"; } function isSerialized($str) { return ($str == serialize(false) || @unserialize($str) !== false); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 10
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sgT91
function name:  (null)
number of ops:  12
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'lol'
    5     1        INIT_FCALL_BY_NAME                                       'isSerialized'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0  $2      
          4        TYPE_CHECK                                    8          $2
          5      > JMPZ                                                     ~3, ->10
    6     6    >   INIT_FCALL                                               'unserialize'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
          9      > JMP                                                      ->11
    8    10    >   ECHO                                                     'KO'
   14    11    > > RETURN                                                   1

Function isserialized:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 6, Position 2 = 13
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/sgT91
function name:  isSerialized
number of ops:  15
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   13     1        INIT_FCALL                                               'serialize'
          2        SEND_VAL                                                 <false>
          3        DO_ICALL                                         $1      
          4        IS_EQUAL                                         ~2      !0, $1
          5      > JMPNZ_EX                                         ~2      ~2, ->13
          6    >   BEGIN_SILENCE                                    ~3      
          7        INIT_FCALL                                               'unserialize'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $4      
         10        END_SILENCE                                              ~3
         11        TYPE_CHECK                                  1018  ~5      $4
         12        BOOL                                             ~2      ~5
         13    > > RETURN                                                   ~2
   14    14*     > RETURN                                                   null

End of function isserialized

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.89 ms | 1396 KiB | 17 Q