@@ -351,8 +351,8 @@ PHP_FUNCTION(flock)
351351
352352 act = operation & 3 ;
353353 if (act < 1 || act > 3 ) {
354- php_error_docref ( NULL , E_WARNING , "Illegal operation argument" );
355- RETURN_FALSE ;
354+ zend_value_error ( "Illegal operation argument" );
355+ RETURN_THROWS () ;
356356 }
357357
358358 if (wouldblock ) {
@@ -745,8 +745,8 @@ PHP_FUNCTION(file)
745745 ZEND_PARSE_PARAMETERS_END ();
746746
747747 if (flags < 0 || flags > (PHP_FILE_USE_INCLUDE_PATH | PHP_FILE_IGNORE_NEW_LINES | PHP_FILE_SKIP_EMPTY_LINES | PHP_FILE_NO_DEFAULT_CONTEXT )) {
748- php_error_docref ( NULL , E_WARNING , "'" ZEND_LONG_FMT "' flag is not supported" , flags );
749- RETURN_FALSE ;
748+ zend_value_error ( "'" ZEND_LONG_FMT "' flag is not supported" , flags );
749+ RETURN_THROWS () ;
750750 }
751751
752752 use_include_path = flags & PHP_FILE_USE_INCLUDE_PATH ;
@@ -1040,8 +1040,8 @@ PHPAPI PHP_FUNCTION(fgets)
10401040 efree (buf );
10411041 } else if (argc > 1 ) {
10421042 if (len <= 0 ) {
1043- php_error_docref ( NULL , E_WARNING , "Length parameter must be greater than 0" );
1044- RETURN_FALSE ;
1043+ zend_value_error ( "Length parameter must be greater than 0" );
1044+ RETURN_THROWS () ;
10451045 }
10461046
10471047 str = zend_string_alloc (len , 0 );
@@ -1495,8 +1495,8 @@ PHP_NAMED_FUNCTION(php_if_ftruncate)
14951495 ZEND_PARSE_PARAMETERS_END ();
14961496
14971497 if (size < 0 ) {
1498- php_error_docref ( NULL , E_WARNING , "Negative size is not supported" );
1499- RETURN_FALSE ;
1498+ zend_value_error ( "Negative size is not supported" );
1499+ RETURN_THROWS () ;
15001500 }
15011501
15021502 PHP_STREAM_TO_ZVAL (stream , fp );
@@ -1750,8 +1750,8 @@ PHPAPI PHP_FUNCTION(fread)
17501750 PHP_STREAM_TO_ZVAL (stream , res );
17511751
17521752 if (len <= 0 ) {
1753- php_error_docref ( NULL , E_WARNING , "Length parameter must be greater than 0" );
1754- RETURN_FALSE ;
1753+ zend_value_error ( "Length parameter must be greater than 0" );
1754+ RETURN_THROWS () ;
17551755 }
17561756
17571757 str = php_stream_read_to_str (stream , len );
@@ -1829,8 +1829,8 @@ PHP_FUNCTION(fputcsv)
18291829 if (delimiter_str != NULL) {
18301830 /* Make sure that there is at least one character in string */
18311831 if (delimiter_str_len < 1 ) {
1832- php_error_docref ( NULL , E_WARNING , "delimiter must be a character" );
1833- RETURN_FALSE ;
1832+ zend_value_error ( "delimiter must be a character" );
1833+ RETURN_THROWS () ;
18341834 } else if (delimiter_str_len > 1 ) {
18351835 php_error_docref (NULL , E_NOTICE , "delimiter must be a single character" );
18361836 }
@@ -1841,8 +1841,8 @@ PHP_FUNCTION(fputcsv)
18411841
18421842 if (enclosure_str != NULL ) {
18431843 if (enclosure_str_len < 1 ) {
1844- php_error_docref ( NULL , E_WARNING , "enclosure must be a character" );
1845- RETURN_FALSE ;
1844+ zend_value_error ( "enclosure must be a character" );
1845+ RETURN_THROWS () ;
18461846 } else if (enclosure_str_len > 1 ) {
18471847 php_error_docref (NULL , E_NOTICE , "enclosure must be a single character" );
18481848 }
@@ -1967,8 +1967,8 @@ PHP_FUNCTION(fgetcsv)
19671967 if (delimiter_str != NULL ) {
19681968 /* Make sure that there is at least one character in string */
19691969 if (delimiter_str_len < 1 ) {
1970- php_error_docref ( NULL , E_WARNING , "delimiter must be a character" );
1971- RETURN_FALSE ;
1970+ zend_value_error ( "delimiter must be a character" );
1971+ RETURN_THROWS () ;
19721972 } else if (delimiter_str_len > 1 ) {
19731973 php_error_docref (NULL , E_NOTICE , "delimiter must be a single character" );
19741974 }
@@ -1979,8 +1979,8 @@ PHP_FUNCTION(fgetcsv)
19791979
19801980 if (enclosure_str != NULL ) {
19811981 if (enclosure_str_len < 1 ) {
1982- php_error_docref ( NULL , E_WARNING , "enclosure must be a character" );
1983- RETURN_FALSE ;
1982+ zend_value_error ( "enclosure must be a character" );
1983+ RETURN_THROWS () ;
19841984 } else if (enclosure_str_len > 1 ) {
19851985 php_error_docref (NULL , E_NOTICE , "enclosure must be a single character" );
19861986 }
@@ -2004,8 +2004,8 @@ PHP_FUNCTION(fgetcsv)
20042004 if (len_zv != NULL && Z_TYPE_P (len_zv ) != IS_NULL ) {
20052005 len = zval_get_long (len_zv );
20062006 if (len < 0 ) {
2007- php_error_docref ( NULL , E_WARNING , "Length parameter may not be negative" );
2008- RETURN_FALSE ;
2007+ zend_value_error ( "Length parameter may not be negative" );
2008+ RETURN_THROWS () ;
20092009 } else if (len == 0 ) {
20102010 len = -1 ;
20112011 }
0 commit comments