3v4l.org

run code in 300+ PHP versions simultaneously
<?php session_start(); session_write_close(); var_dump(defined('SID')); var_dump(sessionStatus()); // this would return false function sessionStatus() { if (function_exists('session_status')) { return (session_status() == PHP_SESSION_ACTIVE); } return defined('SID'); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RehHP
function name:  (null)
number of ops:  14
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'session_start'
          1        DO_ICALL                                                 
    3     2        INIT_FCALL                                               'session_write_close'
          3        DO_ICALL                                                 
    4     4        INIT_FCALL                                               'var_dump'
          5        DEFINED                                          ~2      'SID'
          6        SEND_VAL                                                 ~2
          7        DO_ICALL                                                 
    5     8        INIT_FCALL                                               'var_dump'
          9        INIT_FCALL_BY_NAME                                       'sessionStatus'
         10        DO_FCALL                                      0  $4      
         11        SEND_VAR                                                 $4
         12        DO_ICALL                                                 
   12    13      > RETURN                                                   1

Function sessionstatus:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 8
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RehHP
function name:  sessionStatus
number of ops:  11
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                               'function_exists'
          1        SEND_VAL                                                 'session_status'
          2        DO_ICALL                                         $0      
          3      > JMPZ                                                     $0, ->8
    9     4    >   INIT_FCALL                                               'session_status'
          5        DO_ICALL                                         $1      
          6        IS_EQUAL                                         ~2      $1, 2
          7      > RETURN                                                   ~2
   11     8    >   DEFINED                                          ~3      'SID'
          9      > RETURN                                                   ~3
   12    10*     > RETURN                                                   null

End of function sessionstatus

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.48 ms | 1395 KiB | 23 Q