How do I delete a function body in a php class using the sed or awk or grep commands?

how to delete the method body in a class using the sed or awk or grep commands

sample source file: demo.php

<?php
class Demo {
    private $a;
}

of course, there may be many methods in the class.

Aug.20,2021

sed ':a;N;$!ba;s/public.*/}/' demo.php

modify the source file directly:

sed -i ':a;N;$!ba;s/public.*/}/' demo.php
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3a70b-2c1f5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3a70b-2c1f5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?