3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types = 1); class OrderFill { public function __construct( public float $timestampms, public string $size, public string $price, public ?string $amount = NULL, public string $fee_usd, public string $exchangeOrderId, public string $tradeId, ) { var_dump($amount); } } new OrderFill( timestampms: 1.0, size: "1", price: "1", fee_usd: "1", exchangeOrderId: "1", tradeId: "1", );
Output for 8.0.0 - 8.0.3
NULL
Output for 7.3.0 - 7.3.28, 7.4.0 - 7.4.16
Parse error: syntax error, unexpected 'public' (T_PUBLIC), expecting variable (T_VARIABLE) in /in/MOecm on line 5
Process exited with code 255.

preferences:
74.36 ms | 457 KiB | 5 Q