使用 phpqrcode 生成 SVG 时出错

Error generating SVG with phpqrcode

我正在尝试执行文档 SVG basic output example 中的以下代码。

<?php
include('vendors/phpqrcode/qrlib.php');
$svgCode = QRcode::svg('PHP QR Code :)');
echo $svgCode; 

我得到的只是错误:

Fatal error: Call to undefined method QRcode::svg()

/path/to/php/file/index.php on line 1337

奇怪的是,简单的 PNG 输出示例工作正常,没有任何错误,因此包含必须正确。

<?php
include('vendors/phpqrcode/qrlib.php');
QRcode::png('PHP QR Code :)');

你们知道我可能忘了检查什么吗?也许这个错误对你来说很明显。

another thread and I experienced myself, the latest version is at https://github.com/t0k4rt/phpqrcode 中所述。有了那里的版本,SVG 就可以实现并工作了。