source: src/router/php7/Zend/tests/return_types/void_disallowed2.phpt @ 31874

Last change on this file since 31874 was 31874, checked in by brainslayer, 6 weeks ago

update php

File size: 328 bytes
Line 
1--TEST--
2void return type: unacceptable cases: explicit return of some other value
3--FILE--
4<?php
5
6function foo(): void {
7    return -1; // not permitted in a void function
8}
9
10// Note the lack of function call: function validated at compile-time
11--EXPECTF--
12Fatal error: A void function must not return a value in %s on line %d
Note: See TracBrowser for help on using the repository browser.