3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * When there's no other way than dying, at least do it nicely. * @param string $message The message to show. * @param string|null $file File where problem occured (leave empty to autodetect). * @param integer $line Line of code causing the issue. */ function kbm_fatal($message, $file='', $line=0){ if(!$file){ $trace = debug_backtrace(); if(isset($trace[1]) && isset($trace[1]['file']))$file = $trace[1]['file']; if(isset($trace[1]) && isset($trace[1]['line']))$line = $trace[1]['line']; $file = $file ? basename($file) : 'unknown'; } die("<div style='font: bold 12px Consolas; color: #A00; background: #FFF; padding: 3px; margin: 1px;'>FATAL: $message [$file:$line]</div>"); } function test(){ kbm_fatal('cheese'); } test();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1Sgok
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   INIT_FCALL                                               'test'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   1

Function kbm_fatal:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 34
Branch analysis from position: 5
2 jumps found. (Code = 46) Position 1 = 10, Position 2 = 13
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 17
Branch analysis from position: 14
2 jumps found. (Code = 46) Position 1 = 19, Position 2 = 22
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 26
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 32
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 32
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 26
Branch analysis from position: 22
Branch analysis from position: 17
Branch analysis from position: 13
Branch analysis from position: 34
filename:       /in/1Sgok
function name:  kbm_fatal
number of ops:  43
compiled vars:  !0 = $message, !1 = $file, !2 = $line, !3 = $trace
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      ''
          2        RECV_INIT                                        !2      0
   10     3        BOOL_NOT                                         ~4      !1
          4      > JMPZ                                                     ~4, ->34
   11     5    >   INIT_FCALL                                               'debug_backtrace'
          6        DO_ICALL                                         $5      
          7        ASSIGN                                                   !3, $5
   12     8        ISSET_ISEMPTY_DIM_OBJ                         0  ~7      !3, 1
          9      > JMPZ_EX                                          ~7      ~7, ->13
         10    >   FETCH_DIM_IS                                     ~8      !3, 1
         11        ISSET_ISEMPTY_DIM_OBJ                         0  ~9      ~8, 'file'
         12        BOOL                                             ~7      ~9
         13    > > JMPZ                                                     ~7, ->17
         14    >   FETCH_DIM_R                                      ~10     !3, 1
         15        FETCH_DIM_R                                      ~11     ~10, 'file'
         16        ASSIGN                                                   !1, ~11
   13    17    >   ISSET_ISEMPTY_DIM_OBJ                         0  ~13     !3, 1
         18      > JMPZ_EX                                          ~13     ~13, ->22
         19    >   FETCH_DIM_IS                                     ~14     !3, 1
         20        ISSET_ISEMPTY_DIM_OBJ                         0  ~15     ~14, 'line'
         21        BOOL                                             ~13     ~15
         22    > > JMPZ                                                     ~13, ->26
         23    >   FETCH_DIM_R                                      ~16     !3, 1
         24        FETCH_DIM_R                                      ~17     ~16, 'line'
         25        ASSIGN                                                   !2, ~17
   14    26    > > JMPZ                                                     !1, ->32
         27    >   INIT_FCALL                                               'basename'
         28        SEND_VAR                                                 !1
         29        DO_ICALL                                         $19     
         30        QM_ASSIGN                                        ~20     $19
         31      > JMP                                                      ->33
         32    >   QM_ASSIGN                                        ~20     'unknown'
         33    >   ASSIGN                                                   !1, ~20
   16    34    >   ROPE_INIT                                     7  ~23     '%3Cdiv+style%3D%27font%3A+bold+12px+Consolas%3B+color%3A+%23A00%3B+background%3A+%23FFF%3B+padding%3A+3px%3B+margin%3A+1px%3B%27%3EFATAL%3A+'
         35        ROPE_ADD                                      1  ~23     ~23, !0
         36        ROPE_ADD                                      2  ~23     ~23, '+%5B'
         37        ROPE_ADD                                      3  ~23     ~23, !1
         38        ROPE_ADD                                      4  ~23     ~23, '%3A'
         39        ROPE_ADD                                      5  ~23     ~23, !2
         40        ROPE_END                                      6  ~22     ~23, '%5D%3C%2Fdiv%3E'
         41      > EXIT                                                     ~22
   17    42*     > RETURN                                                   null

End of function kbm_fatal

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1Sgok
function name:  test
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   INIT_FCALL                                               'kbm_fatal'
          1        SEND_VAL                                                 'cheese'
          2        DO_FCALL                                      0          
   23     3      > RETURN                                                   null

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.09 ms | 1403 KiB | 19 Q