1--TEST-- 2JIT Shift Left: 002 3--INI-- 4opcache.enable=1 5opcache.enable_cli=1 6opcache.file_update_protection=0 7opcache.protect_memory=1 8--EXTENSIONS-- 9opcache 10--FILE-- 11<?php 12function shl0(int $a) { 13 return $a << 0; 14} 15function shl1(int $a) { 16 return $a << 1; 17} 18function shl2(int $a) { 19 return $a << 2; 20} 21function shl64(int $a) { 22 return $a << 64; 23} 24function shlNEG(int $a) { 25 return $a << -1; 26} 27var_dump(shl0(1)); 28var_dump(shl1(1)); 29var_dump(shl2(1)); 30var_dump(shl2(-1)); 31try { 32 var_dump(shl64(1)); 33} catch (Throwable $e) { 34 echo "Exception " . $e->getMessage() . "\n"; 35} 36try { 37 var_dump(shlNEG(1)); 38} catch (Throwable $e) { 39 echo "Exception (" . get_class($e) . "): " . $e->getMessage() . "\n"; 40} 41?> 42--EXPECT-- 43int(1) 44int(2) 45int(4) 46int(-4) 47int(0) 48Exception (ArithmeticError): Bit shift by negative number 49