-
-
Notifications
You must be signed in to change notification settings - Fork 967
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
round(): Argument #1 ($num) must be of type int|float, string given error #757
Comments
I have the same problem. any fix on that? |
I also have the same problem. |
This might not be ideal but this is working and did not came across any side issues yet: on line 3321 of the Style.php script cast the $val variable to integer: round((int)$val) |
On Style.php on line 3321
and change it to
|
please, check your php version. |
Fixed for me after upgrading to 0.9.0
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
This seems to be an issue that occurs with php 8. They need to fix the style.php file and change round($val) to round((int)$val). As lenomosh said. |
Also occurs with PHP 7 if you use strict types. Is there an update on this? |
its working on php v7.4.22 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
This has been fixed in dompdf with a better solution than the ones posted above. Can you confirm when the fixed version will be included in Wordpress. |
NEVER EVER CHANGE VENDOR FILES EVER!!!!!!!!!!!!!!!!!!!!!!!! |
I still have issue here, |
What issue? can you explain more about your issue |
i have same issue with php7.4 and doing |
i reinstall php7.4 and now all working fine |
When I try download pdf after render like this:
PHP 8 and Laravel 8
error:
"message": "round(): Argument #1 ($num) must be of type int|float, string given",
"exception": "TypeError",
"file": "/Users/nizaralmohammad/Sites/tree-with-layout/vendor/dompdf/dompdf/src/Css/Style.php",
"line": 3321,
"trace": [
{
"file": "/Users/nizaralmohammad/Sites/tree-with-layout/vendor/dompdf/dompdf/src/Css/Style.php",
"line": 3321,
"function": "round"
},
{
"file": "/Users/nizaralmohammad/Sites/tree-with-layout/vendor/dompdf/dompdf/src/Css/Style.php",
"line": 894,
"function": "set_z_index",
"class": "Dompdf\Css\Style",
"type": "->"
},
{
"file": "/Users/nizaralmohammad/Sites/tree-with-layout/vendor/dompdf/dompdf/src/Css/Stylesheet.php",
"line": 1638,
"function": "__set",
"class": "Dompdf\Css\Style",
"type": "->"
},
{
"file": "/Users/nizaralmohammad/Sites/tree-with-layout/vendor/dompdf/dompdf/src/Css/Stylesheet.php",
"line": 1671,
"function": "_parse_properties",
"class": "Dompdf\Css\Stylesheet",
"type": "->"
},
{
"file": "/Users/nizaralmohammad/Sites/tree-with-layout/vendor/dompdf/dompdf/src/Css/Stylesheet.php",
"line": 1415,
"function": "_parse_sections",
"class": "Dompdf\Css\Stylesheet",
"type": "->"
},
{
"file": "/Users/nizaralmohammad/Sites/tree-with-layout/vendor/dompdf/dompdf/src/Css/Stylesheet.php",
"line": 420,
"function": "_parse_css",
"class": "Dompdf\Css\Stylesheet",
"type": "->"
},
{
"file": "/Users/nizaralmohammad/Sites/tree-with-layout/vendor/dompdf/dompdf/src/Dompdf.php",
"line": 649,
"function": "load_css_file",
"class": "Dompdf\Css\Stylesheet",
"type": "->"
},
{
"file": "/Users/nizaralmohammad/Sites/tree-with-layout/vendor/dompdf/dompdf/src/Dompdf.php",
"line": 761,
"function": "processHtml",
"class": "Dompdf\Dompdf",
"type": "->"
},
{
"file": "/Users/nizaralmohammad/Sites/tree-with-layout/vendor/barryvdh/laravel-dompdf/src/PDF.php",
"line": 208,
"function": "render",
"class": "Dompdf\Dompdf",
"type": "->"
},
{
"file": "/Users/nizaralmohammad/Sites/tree-with-layout/vendor/barryvdh/laravel-dompdf/src/PDF.php",
"line": 155,
"function": "render",
"class": "Barryvdh\DomPDF\PDF",
"type": "->"
},
{
"file": "/Users/nizaralmohammad/Sites/tree-with-layout/vendor/barryvdh/laravel-dompdf/src/PDF.php",
"line": 178,
"function": "output",
"class": "Barryvdh\DomPDF\PDF",
"type": "->"
},
The text was updated successfully, but these errors were encountered: