3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Active assert and make it quiet assert_options(ASSERT_ACTIVE, 1); assert_options(ASSERT_WARNING, 0); assert_options(ASSERT_QUIET_EVAL, 1); // Create a handler function function my_assert_handler($file, $line, $code, $desc = null) { echo "Assertion failed at file $file, line $line, code $code"; if ($desc) { echo ": $desc"; } echo "\n"; } // Set up the callback assert_options(ASSERT_CALLBACK, 'my_assert_handler'); // Make an assertion that should fail assert('2 < 1', 'Testing if two is less than one');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tImND
function name:  (null)
number of ops:  23
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'assert_options'
          1        SEND_VAL                                                 1
          2        SEND_VAL                                                 1
          3        DO_ICALL                                                 
    4     4        INIT_FCALL                                               'assert_options'
          5        SEND_VAL                                                 4
          6        SEND_VAL                                                 0
          7        DO_ICALL                                                 
    5     8        INIT_FCALL                                               'assert_options'
          9        FETCH_CONSTANT                                   ~2      'ASSERT_QUIET_EVAL'
         10        SEND_VAL                                                 ~2
         11        SEND_VAL                                                 1
         12        DO_ICALL                                                 
   18    13        INIT_FCALL                                               'assert_options'
         14        SEND_VAL                                                 2
         15        SEND_VAL                                                 'my_assert_handler'
         16        DO_ICALL                                                 
   21    17        ASSERT_CHECK                                             
         18        INIT_FCALL                                               'assert'
         19        SEND_VAL                                                 '2+%3C+1'
         20        SEND_VAL                                                 'Testing+if+two+is+less+than+one'
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

Function my_assert_handler:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 15
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/tImND
function name:  my_assert_handler
number of ops:  17
compiled vars:  !0 = $file, !1 = $line, !2 = $code, !3 = $desc
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV_INIT                                        !3      null
   10     4        ROPE_INIT                                     6  ~5      'Assertion+failed+at+file+'
          5        ROPE_ADD                                      1  ~5      ~5, !0
          6        ROPE_ADD                                      2  ~5      ~5, '%2C+line+'
          7        ROPE_ADD                                      3  ~5      ~5, !1
          8        ROPE_ADD                                      4  ~5      ~5, '%2C+code+'
          9        ROPE_END                                      5  ~4      ~5, !2
         10        ECHO                                                     ~4
   11    11      > JMPZ                                                     !3, ->15
   12    12    >   NOP                                                      
         13        FAST_CONCAT                                      ~8      '%3A+', !3
         14        ECHO                                                     ~8
   14    15    >   ECHO                                                     '%0A'
   15    16      > RETURN                                                   null

End of function my_assert_handler

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.22 ms | 1400 KiB | 17 Q