xp-framework / compiler

Compiles future PHP to today's PHP.
19 stars 0 forks source link

Nullable cast (?int) #55

Closed thekid closed 6 years ago

thekid commented 6 years ago
$number = 123; 
(int) $number => 123; 
(?int) $number => 123;

$string = '123'; 
(int) $string => 123; 
(?int) $string => 123;

$null = null; 
(int) $null => 0 
(?int) $null => null

See https://externals.io/message/102997

thekid commented 6 years ago

Already works, now tested and documented at https://github.com/xp-framework/compiler/wiki#casting