3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Psr\Log { class LogLevel { const ALERT = 1; const CRITICAL = 2; const ERROR = 3; const WARNING = 4; } class AbstractLogger { } } namespace FTLabs { use \Psr\Log\LogLevel; final class Logger extends \Psr\Log\AbstractLogger { private static $php_error_to_severity = array( E_ERROR => LogLevel::ALERT, E_CORE_ERROR => LogLevel::ALERT, E_PARSE => LogLevel::ALERT, E_COMPILE_ERROR => LogLevel::ALERT, E_RECOVERABLE_ERROR => LogLevel::CRITICAL, E_USER_ERROR => LogLevel::ALERT, E_COMPILE_WARNING => LogLevel::CRITICAL, E_CORE_WARNING => LogLevel::CRITICAL, E_USER_WARNING => LogLevel::CRITICAL, E_WARNING => LogLevel::CRITICAL, E_NOTICE => LogLevel::ERROR, E_USER_NOTICE => LogLevel::ERROR, E_STRICT => LogLevel::WARNING, E_DEPRECATED => LogLevel::WARNING, E_USER_DEPRECATED => LogLevel::WARNING, ); public static function severityForPhpError($errno) { if (isset(self::$php_error_to_severity[$errno])) { return self::$php_error_to_severity[$errno]; } return LogLevel::ERROR; } } } namespace { use FTLabs\Logger; require 'debug.php'; var_dump(Logger::severityForPhpError(E_USER_NOTICE)); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NptFj
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   49     0  E >   INCLUDE_OR_EVAL                                          'debug.php', REQUIRE
   50     1        INIT_FCALL                                               'var_dump'
          2        INIT_STATIC_METHOD_CALL                                  'FTLabs%5CLogger', 'severityForPhpError'
          3        SEND_VAL                                                 1024
          4        DO_FCALL                                      0  $1      
          5        SEND_VAR                                                 $1
          6        DO_ICALL                                                 
   51     7      > RETURN                                                   1

Class Psr\Log\LogLevel: [no user functions]
Class Psr\Log\AbstractLogger: [no user functions]
Class FTLabs\Logger:
Function severityforphperror:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NptFj
function name:  severityForPhpError
number of ops:  9
compiled vars:  !0 = $errno
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   38     0  E >   RECV                                             !0      
   39     1        FETCH_STATIC_PROP_IS                             ~1      'php_error_to_severity'
          2        ISSET_ISEMPTY_DIM_OBJ                         0          ~1, !0
          3      > JMPZ                                                     ~2, ->7
   40     4    >   FETCH_STATIC_PROP_R          unknown             ~3      'php_error_to_severity'
          5        FETCH_DIM_R                                      ~4      ~3, !0
          6      > RETURN                                                   ~4
   42     7    > > RETURN                                                   3
   43     8*     > RETURN                                                   null

End of function severityforphperror

End of class FTLabs\Logger.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.51 ms | 1395 KiB | 15 Q