1--TEST-- 2class constants as default function arguments 3--FILE-- 4<?php 5 6class test { 7 const val = 1; 8} 9 10function foo($v = test::val) { 11 var_dump($v); 12} 13 14function bar($b = NoSuchClass::val) { 15 var_dump($b); 16} 17 18foo(); 19foo(5); 20 21bar(10); 22bar(); 23 24echo "Done\n"; 25?> 26--EXPECTF-- 27int(1) 28int(5) 29int(10) 30 31Fatal error: Uncaught Error: Class 'NoSuchClass' not found in %s:%d 32Stack trace: 33#0 %s(%d): bar() 34#1 {main} 35 thrown in %s on line %d 36