3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Step 1: Set the cookie BEFORE any HTML output setcookie("abc", "abc_value", time() + 3600); // expires in 1 hour ?> <!DOCTYPE html> <html> <head> <title>PHP Cookie Example</title> </head> <body> <?php // Step 2: Check if cookie is set and display message if (isset($_COOKIE['abc'])) { echo "Hello, visiting again! Cookie value: " . $_COOKIE['abc']; } else { echo "Your first visit."; } ?> </body> </html>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 17
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XLuOF
function name:  (null)
number of ops:  20
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'setcookie'
          1        SEND_VAL                                                 'abc'
          2        SEND_VAL                                                 'abc_value'
          3        INIT_FCALL                                               'time'
          4        DO_ICALL                                         $0      
          5        ADD                                              ~1      $0, 3600
          6        SEND_VAL                                                 ~1
          7        DO_ICALL                                                 
    5     8        ECHO                                                     '%0A%3C%21DOCTYPE+html%3E%0A%3Chtml%3E%0A%3Chead%3E%0A++++%3Ctitle%3EPHP+Cookie+Example%3C%2Ftitle%3E%0A%3C%2Fhead%3E%0A%3Cbody%3E%0A%0A'
   15     9        FETCH_IS                                         ~3      '_COOKIE'
         10        ISSET_ISEMPTY_DIM_OBJ                         0          ~3, 'abc'
         11      > JMPZ                                                     ~4, ->17
   16    12    >   FETCH_R                      global              ~5      '_COOKIE'
         13        FETCH_DIM_R                                      ~6      ~5, 'abc'
         14        CONCAT                                           ~7      'Hello%2C+visiting+again%21+Cookie+value%3A+', ~6
         15        ECHO                                                     ~7
   15    16      > JMP                                                      ->18
   18    17    >   ECHO                                                     'Your+first+visit.'
   21    18    >   ECHO                                                     '%0A%3C%2Fbody%3E%0A%3C%2Fhtml%3E'
   23    19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.1 ms | 1005 KiB | 15 Q