3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array1 = array( 'E_ERROR' => array('PHP' => '0'), 'E_WARNING' => array('PHP' => '0'), 'E_PARSE' => array('PHP' => '0'), 'E_NOTICE' => array('PHP' => '0'), 'E_CORE_ERROR' => array('PHP' => '4.x'), 'E_CORE_WARNING' => array('PHP' => '4.x'), 'E_COMPILE_ERROR' => array('PHP' => '4.x'), 'E_COMPILE_WARNING' => array('PHP' => '4.x'), 'E_USER_ERROR' => array('PHP' => '4.x'), 'E_USER_WARNING' => array('PHP' => '4.x'), 'E_USER_NOTICE' => array('PHP' => '4.x'), 'E_STRICT' => array('PHP' => '5.x', 'IN_E_ALL_SINCE' => array('PHP' => '5.4.x')), 'E_RECOVERABLE_ERROR' => array('PHP' => '5.2.0'), 'E_DEPRECATED' => array('PHP' => '5.3.0'), 'E_USER_DEPRECATED' => array('PHP' => '5.3.0'), 'E_ALL' => array('PHP' => '0', 'PHP_VERSION_VALUE_DIFF' => array('5.4.x' => '32767', '5.3.x' => '30719', '5.2.x' => '6143', '0' => '2047')) ); $array2 = $array1; unset($array2['E_ALL']); $array1 = array_reverse($array1); echo 'PHP: '.PHP_VERSION."<br />"; $sCompareTo = '5.4.6'; if (version_compare(PHP_VERSION, $sCompareTo) >= 0) { echo 'Mindestens PHP '.$sCompareTo.', naemlich: ' . PHP_VERSION . "\n"; } else { echo "kleiner ".$sCompareTo; } $output[E_ALL] = E_ALL." = E_ALL"; foreach($array1 as $ki => $i){ $iCalcSum = 0; if($ki != 'E_ALL') { $sSum = ""; $bFlag = false; foreach($array2 as $kk => $k){ if(($kk == $ki) && !$bFlag) { $bFlag = true; $sSum = " E_ALL ".$sSum; } $iVal = constant($kk); if($bFlag) { $sSum .= " <b>~ $kk($iVal)</b>"; $iCalcSum = $iCalcSum - $iVal; } else { $sSum .= " $kk($iVal)"; $iCalcSum = $iCalcSum + $iVal; } $iAll = E_ALL; if($iCalcSum <= 0) $iRealSum = E_ALL + $iCalcSum; else $iRealSum = $iCalcSum; //$output[$iCalcSum] = "($iAll + $iCalcSum) =".$iRealSum."$sSum"; $output[$iRealSum] = $iRealSum." = $sSum"; } } } krsort($output); echo "<pre>"; print_r($output); echo "</pre>";

Abusive script

This script was stopped while abusing our resources